I just found a bug in my app caused by casting GLib/GTK pointer types using as. GTK has macros/functions like G_OBJECT, GTK_WIDGET, GTK_BOX etc. for casting and we need to use those. (also see the warning messages printed to console, those indicates errors in the wrappers)
I think we need to change traits to something like this:
We also need to remove as syntax used in macros like impl_TraitWidget! and use proper casting instead. Unfortunately this means adding whole lot of wrappers(like the ones in gtk_glue.c) from every widget type to GObject etc. I'm wondering if there's a better way to do this without using as at all.
I just found a bug in my app caused by casting GLib/GTK pointer types using
as
. GTK has macros/functions likeG_OBJECT
,GTK_WIDGET
,GTK_BOX
etc. for casting and we need to use those. (also see the warning messages printed to console, those indicates errors in the wrappers)I think we need to change traits to something like this:
(not tested)
We also need to remove
as
syntax used in macros likeimpl_TraitWidget!
and use proper casting instead. Unfortunately this means adding whole lot of wrappers(like the ones ingtk_glue.c
) from every widget type toGObject
etc. I'm wondering if there's a better way to do this without usingas
at all.