[pygtk] Need help with GtkToolItemType setting

Артём Попов artfwo at gmail.com
Thu Aug 10 18:19:30 WST 2006


Hello,

I've been trying to use the new (in 2.9.4) feature of setting ToolItem
type in gtk.Action, (I need a toolitem with a dropdown menu). I was
doing something like:

class MenuToolAction(gtk.Action):
    pass
MenuToolAction.set_tool_item_type(gtk.MenuToolButton)

...then creating a bunch of actions the usual way (the entries), then
doing something like:

custom_action = MenuToolAction()
group.add_action(custom_action)

The result is bizzare: ALL toolbar buttons now have a (disabled) arrow
next to them, only the actual action, that should have a menu has the
enabled arrow with the dropdown menu.

I realize, that by calling
"MenuToolAction.set_tool_item_type(gtk.MenuToolButton)" I somehow set
the "tool_item_type" class attribute for gtk.Action and NOT my
subclass. Then, how do I set the attribute only for the subclass? I
apologize, if I'm asking a dumb question, but I simply have not done
anything like this before. Thanks in advance for your help.

--Artem


More information about the pygtk mailing list