[pygtk] trouble creating a gtk.MenuToolButton

John Finlay finlay at moeraki.com
Sun Mar 23 12:53:25 WST 2008


Eike Nicklas wrote:
> 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?
>
>   
menu_item.show()

John


More information about the pygtk mailing list