[pygtk] trouble creating a gtk.MenuToolButton

Eike Nicklas lists at ephys.de
Sat Mar 22 18:45:25 WST 2008


Hi list,

I am trying to populate a gtk.MenuToolButton with a menu. Since
uimanager sadly seems to have no support for menutoolbuttons, I am
trying to create one by hand with (complete code attached):

menubutton = gtk.MenuToolButton(gtk.STOCK_PREFERENCES)
menu = gtk.Menu()
menu_item = gtk.MenuItem('some menu item')
menu.append(menu_item)
menubutton.set_menu(menu)
toolbar = gtk.Toolbar()
toolbar.insert(menubutton, 0)

The button shows up fine, but the drop-down menu is empty. What am I
missing?

Thanks a lot for your help,
Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: menu.py
Type: text/x-python
Size: 728 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20080322/90465f2a/menu.py


More information about the pygtk mailing list