I am working on a PyGTK application with a Gtk.Toolbar
. One of the items in taht toolbar is a Gtk.MenuToolButton
. However, clicking on the arrow once the program runs results in an empty menu (a tiny white sliver). Here is the code that sets up the menu:
self.compileMenu = Gtk.Menu()
self.defaultCompileOption = Gtk.MenuItem(label = "Compile with defaults")
self.configCompileOption = Gtk.MenuItem(label = "Change compile options...")
self.compileWithFiles = Gtk.MenuItem(label = "Bundle files...")
self.compileMenu.append(self.defaultCompileOption)
self.compileMenu.append(self.configCompileOption)
self.compileMenu.append(self.compileWithFiles)
self.compileButton = Gtk.MenuToolButton(icon_name = "x-package-repository", label = "Compile...", menu = self.compileMenu)
There is also a call to self.toolbar.add
at the bottom, to add the MenuToolButton
to the toolbar.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…