*Utiliza la seƱal "clicked"* boton.connect("clicked", self.get_menu)
def get_menu(self, widget): menu = gtk.Menu() item = gtk.MenuItem("Archivos Externos") menu.append(item) item.connect_object("activate", self.emit_load_list, 8) item = gtk.MenuItem("JAMediaTube") menu.append(item) item.connect_object("activate", self.emit_load_list, 0) menu.show_all() gtk.Menu.popup(menu, None, None, None, 1, 0) 2012/11/17 Steffen Ganschow <steffen.gansc...@online.de> > 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 > > > > > > > _______________________________________________ > pygtk mailing list pygtk@daa.com.au > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ >
_______________________________________________ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/