There's nothing wrong with your use of Gtk. Just your method signature that
cannot be called with a GtkDrawingAreaK:

function canvas_on_draw_event(::Ptr{GObject},cc::Ptr{Void},widget::GtkCanvas)
# cc is a Cairo context

Note that Gtk.GtkDrawingArea already is defined, so you don't need to use
any macros. It's just missing an outer constructor. To do so, define an
outer constructors for GtkDrawingAreaLeaf, and it will get picked up for
Gtk.@DrawingArea (until https://github.com/JuliaLang/julia/pull/8008 is
merged and I can finally simplify things).


On Fri, Oct 17, 2014 at 6:12 AM, Andreas Lobinger <[email protected]>
wrote:

> Hello,
>
> On Thursday, October 16, 2014 3:03:34 PM UTC+2, Isaiah wrote:
>>
>> Your error looks to be in gtk.jl. try to make a reduced example.
>
>
> well, the error is somehow on my side, as i try to extend Gtk.jl while not
> fully understanding the internals...
>
> I want to have a plain GtkDrawingArea (not the GtkCanvas with all the help
> functions defined in cairo.jl and similar), because i want to port some
> python/pygtk code (and it's also closer to the Gtk documentation). I forgot
> to look more closely at cairo.jl which uses (as in all gtk widget
> functions) a macro gtktype which seems to do some magic with the argument
> names to derive from (e.g.) GtkDrawingArea the name gtk_drawing_area,
> something that doesn't fully work with the module prefix (e.g.)
> Gtk.GtkDrawingArea ~> gtk_gtk_drawing_area (i have not checked, but i
> assume).
>
> I'll go on working with a local copy of cairo.jl and maybe later provide a
> PR to Gtk.jl.
>
> Still, there is room for improvement about the error messages themselfs
> and there should be somehow a counterpart in the documentation (yes, i
> know, filing an issue would be nice).
>
> Wishing a happy day from rainy Bavaria,
>           Andreas
>

Reply via email to