[Glade-users] custom handlers in libglade and gtk builder

Tristan Van Berkom tristan.van.berkom at gmail.com
Fri May 1 11:07:54 EDT 2009


Hi,
   GtkBuilder does not support this method of inserting custom objects
in the interface, instead GTK+ now allows all widgets to be loadable
with builder and the way GtkBuilder builds your objects can be customized
using the GtkBuilder interface.

We assume here that if you are not introducing a real type, if you only
had a function that created stock widgets manually and returned that;
you can easily replace that by adding manually built widgets to a known
container in the project.

With Glade, we have for a long time supported getting your widget
types into the palette and thats been improving over the years,
the documentation is pretty up to date but its a little terse (its not
a tutorial):
  http://glade.gnome.org/docs/

Keep in mind that its possible to mimic your widget type completely
by just writing up a few lines of xml, while the docs describe lots of
things you can do with a plugin library, usually most of that is unneeded.
Also remember that if you provide the actual type at runtime to Glade
in the form of a library, Glade will introspect your custom widgets properties
and signals etc - if you fake the type in the catalog you'll have to define
properties for it manually in the Glade catalog.

Cheers,
          -Tristan

On Fri, May 1, 2009 at 10:36 AM, Gerald Britton
<gerald.britton at gmail.com> wrote:
> Hi -- I'm converting a project from libglade to gtkbuilder and I've
> run into a snag with custom objects.  In the code I'm working on there
> is the line:
>
>    from gtk.glade import set_custom_handler
>
> followed by a function definition:
>
>    def get_custom_handler(glade, function_name, widget_name,
>                       str1, str2, int1, int2)
>
>    ...
>
> and
>
>    set_custom_handler(get_custom_handler)
>
> I need to know how to do the same sort of thing in the gtkbuilder
> world.  So, how does one set up custom handlers in the gtk.builder
> world?
>
> --
> Gerald Britton
> _______________________________________________
> Glade-users maillist  -  Glade-users at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/glade-users
>


More information about the Glade-users mailing list