after adding menu to GtkMenuButton it is not showing,tried different box to contain it(no use),anyone can say what i amdoing wrong?
from gi.repository import Gtk
class Window(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self)
self.set_default_size(400, 200)
self.set_default_geometry(400, 200)
hb = Gtk.HeaderBar()
hb.props.show_close_button = True
hb.props.title = "Click me"
self.set_titlebar(hb)
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
pmenu = Gtk.Menu()
pmenu.append(Gtk.MenuItem(label="lp"))
pmenu.append(Gtk.MenuItem(label="pl"))
mb = Gtk.MenuButton(popup=pmenu)
box.add(mb)
hb.pack_end(box)
win = Window()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()