[pygtk] Popup menu to appear on left mouse click

Steffen Ganschow steffen.ganschow at online.de
Sun Nov 18 04:05:33 WST 2012


Hi,
I want to invoke a popup menu on left mouse click on a TextTag object. I 
connected the signal by:
     self.tag.connect("event", self.tag_event_handler)
to this slot:
    def tag_event_handler(self, tag, widget, event, iter):
       if event.type == gtk.gdk.BUTTON_PRESS:
          if event.button == 1:
             self.show_the_popup(widget, event)

With this code nothing happens when I click on the the TextTag "self.tag".
The menu pops up if I omit the 'if event.button == 1:' condition and 
right-click on the tag. But then also the system context menu (ubuntu) 
appears. How can I get the menu on right mouse click? Any ideas?
Steffen





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20121117/6cc7144b/attachment.html>


More information about the pygtk mailing list