IoLanguage / Cairo

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Try to run samples, get error #1

Open FredrikMeyer opened 4 years ago

FredrikMeyer commented 4 years ago

Hi,

I was just exploring this library, but I cannot get any of the samples to run.

I am on a Mac. I have installed Cairo (through brew install cairo), and this library. But when I try to run any of the sketches, I get

 ~/code/io-test  io dash.io

  Exception: Surface does not respond to 'writeToPNG'
  ---------
  Surface writeToPNG                   dash.io 37
  Chart draw                           dash.io 41
  CLI doFile                           Z_CLI.io 140
  CLI run                              IoState_runCLI() 1

Is it anything obvious that I do wrong?

Thanks!

stevedekorte commented 4 years ago

Can you introspect Surface to see what methods it has? Maybe this method was renamed.

FredrikMeyer commented 4 years ago

Thanks for the quick reply!

Here's the output of surface slotNames: list()

And of surface protos:


list( Surface_0x7f8ed72f5380:
  createSimilar    = CairoSurface_createSimilar()
  finish           = CairoSurface_finish()
  flush            = CairoSurface_flush()
  getContent       = CairoSurface_getContent()
  getDeviceOffset  = CairoSurface_getDeviceOffset()
  getFontOptions   = CairoSurface_getFontOptions()
  markDirty        = CairoSurface_markDirty()
  markDirtyRectangle = CairoSurface_markDirtyRectangle()
  setDeviceOffset  = CairoSurface_setDeviceOffset()
  setFallbackResolution = CairoSurface_setFallbackResolution()
  type             = "Surface"
)
FredrikMeyer commented 4 years ago

Also, the snippet

 if (Cairo HAS_PNG_FUNCTIONS not,
    Exception raise("Can't run sample because cairo was compiled without PNG support")
)

is run in the beginning of the file. (from Sample.io)