[pygtk] popup menu
John Wood
johwo077 at gmail.com
Mon Dec 18 08:16:32 WST 2006
You are creating the popup menu in the function
on_status_icon_right_clicked, you need to create it in a more global
scope. Where you connect the right click event of the statusicon would
be a good place I think.
John
2006/12/17, Peter Morgan <pm at daffodil.uk.com>:
> I got the statusIcon working which is cool
>
> When I right click I want a popup menu to occur which it does with the
> code below..
>
> However I have to hold down the right mouse button otherwise it dissapears.
>
> Dont know where to go from here or am I missing something obvious?
>
> tia
>
> Pete
>
> def on_status_icon_right_clicked(self, widget, button,activate_time):
> print "Right Click"
> popupMenu = gtk.Menu()
> menuPopup1 = gtk.ImageMenuItem (gtk.STOCK_OPEN)
> popupMenu.add(menuPopup1)
> menuPopup2 = gtk.ImageMenuItem (gtk.STOCK_OK)
> popupMenu.add(menuPopup2)
> popupMenu.show_all()
> # parent_menu_shell, parent_menu_item, func, button,
> activate_time, data=None
> popupMenu.popup(None, None, None,
> 1, 0)
> #def show_menu(self, status_icon, button, activate_time, arg0=None):
> #self.menu.popup(None, None, None, button, activate_time)
> _______________________________________________
> pygtk mailing list pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>
More information about the pygtk
mailing list