[Glade-users] Recommended way to work with custom widget



On Fri, 2007-09-28 at 11:16 +0200, Jaap Haitsma wrote:
Hi,

I have custom widget (derived from GtkDrawingArea). What's the
recommended way to work with just a custom widget in glade?

Should I just not put a widget and in the code add the widget to a
GtkBin that I put in the glade file?

Hi, sorry there is no real documentation about this at the moment.

please, the simplest way is to follow instructions in my blog post[1],
that will get you the widget in the glade runtime (remember to set
the parent attribute to GtkDrawingArea)... then in your libglade
application you need to call:

   glade_provides ("name"); /* the name of the catalog in glade */
   glade_register_widget (FOO_TYPE_BAR, glade_standard_build_widget,
                          NULL, NULL); /* FOO_TYPE_BAR is your real type */


Cheers,
            -Tristan


[1]http://blogs.gnome.org/tvb/2007/07/25/some-popular-features/






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]