[Bug 1171433] Re: Popup menu doesn't work

POPSuL 1171433 at bugs.launchpad.net
Sat Apr 27 12:37:18 UTC 2013


Hello again. During the time while I waited an answer about this issue I found temporary solution for solve it problem.
Attached example has contains a following part of the code:

def on_button_press(w, event):
    if event.button == 3:
        menu = Menu()
        menu.add(Gtk.MenuItem("item 1"))
        menu.show_all()
        menu.popup(None, None, lambda menu, data: (event.get_root_coords()[0], event.get_root_coords()[1], True), None, event.button, event.time)

But if it is rewritten so:

menu = Menu()
def on_button_press(w, event):
    if event.button == 3:
        menu.add(Gtk.MenuItem("item 1"))
        menu.show_all()
        menu.popup(None, None, None, None, event.button, event.time)

menu works perfectly without any bugs.
So, I think it's a bug because first example works with version 3.4 of the gir1.2-gtk-3.0 package, but, with version 3.6+ menu doesn't work.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gobject-introspection in
Ubuntu.
https://bugs.launchpad.net/bugs/1171433

Title:
  Popup menu doesn't work

Status in “gobject-introspection” package in Ubuntu:
  Confirmed

Bug description:
  Hi guys!
  I'm using a Python and gir bindings to libgtk3, and I've trouble with Gtk.Menu
  (and gi.overrides.Menu) in Ubuntu Raring and guess that is bug. After calling

  menu.popup(None, None, lambda menu, data: (event.get_root_coords()[0],
  event.get_root_coords()[1], True), None, event.button, event.time)

  the popup-menu doesn't appear, if menu has added within ListView/TreeView or
  some other widgets. Popup menu works only if it was been added on Tab of the
  Notetab widget.

  I've roughly the list of package versions (latest version of the Ubuntu, 13.04):
  $ dpkg -l | grep -E "ii\s\s(python|python-gi|gir1.2-gtk-3.0|libgtk-3-0)(\s|\:)"
  ii  gir1.2-gtk-3.0            3.6.4-0ubuntu7       amd64        GTK+ graphical
  user interface library -- gir bindings
  ii  libgtk-3-0:amd64          3.6.4-0ubuntu7       amd64        GTK+ graphical
  user interface library
  ii  python                    2.7.4-0ubuntu1       amd64        interactive
  high-level object-oriented language (default version)
  ii  python-gi                 3.8.0-2              amd64        Python 2.x
  bindings for gobject-introspection libraries

  But, under Ubuntu 12.10 with following list of packages all be ok, and menu
  appearing:
  ii  gir1.2-gtk-3.0            3.6.0-0ubuntu3.2     amd64        GTK+ graphical
  user interface library -- gir bindings
  ii  libgtk-3-0:amd64          3.6.0-0ubuntu3.2     amd64        GTK+ graphical
  user interface library
  ii  python                    2.7.3-0ubuntu7       amd64        interactive
  high-level object-oriented language (default version)
  ii  python-gi                 3.4.0-1ubuntu0.1     amd64        Python 2.x
  bindings for gobject-introspection libraries

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gobject-introspection/+bug/1171433/+subscriptions




More information about the foundations-bugs mailing list