[pygtk] Clickable MenuItem with submenu?
Miguel Ángel García
magmaxlistas at gmail.com
Fri Oct 24 13:49:53 WST 2008
Here you are:
#buind the menu
menu = gtk.Menu()
#create an item
item = gtk.ImageMenuItem(gtk.STOCK_COPY)
item.connect ("activate", myfunction, None)
#append it
menu.append(item)
#built the submenu
submenu = gtk.Menu()
#well... append the same item built before
submenu.append(item)
#build another item and attach it the sub menu
item = gtk.ImageMenuItem(gtk.STOCK_EDIT)
item.set_submenu(submenu)
#all together
menu.append(item)
I think you problem was that you was trying to use "activate" signal to
launch the submenu as another popup. It is simplier :-D
El Thu, 16 Oct 2008 11:22:41 +0400
Igor Mammedov <niallain en gmail.com> escribió:
> Hi Everyone!
>
> I've following menu structure:
>
> Menu
> |
> Filter1 (MenuItem with submenu)
> |
> Filter2 (MenuItem)
>
> When I click on Filter1 menu popup disappears and I app
> receives 'activate' signal.
>
> Question is how can I get the same effect on Filter1?
> (i.e. when I click on Filter1, app shall at least close
> whole popup menu and possibly generate 'activate' signal)
>
>
>
> _______________________________________________
> pygtk mailing list pygtk en daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
--
In a world without walls and fences, who needs Windows and Gates?
More information about the pygtk
mailing list