[pygtk] Re: Need help with GtkToolItemType setting

Johan Dahlin jdahlin at async.com.br
Thu Aug 10 19:37:16 WST 2006


Артём Попов skrev:
> Never mind, I've just figured out that a __gtype_name__ line needs to
> be added and everything then works as expected. This is a working
> version:
>
> class MenuToolAction(gtk.Action):
>    __gtype_name__ = "MenuToolAction"
> MenuToolAction.set_tool_item_type(gtk.MenuToolButton)
>
> But I'm still wondering, why the first version did not work? Isn't
> __gtype_name__ set automatically nowadays?
A GType is not automatically registered for a GObject subclass.
You can either register it manually by calling gobject.type_register() or
automatically by setting a property, signal or a name.

Johan



More information about the pygtk mailing list