[pygtk] Adding and deleting items from a menu

Fabrice DELENTE fdelente at mail.cpod.fr
Mon Aug 17 16:54:06 WST 2009


Hello.

I'm trying to dynamically add and delete items from a drop-down menu-bar.

My code is:

self.wTree=gtk.glade.XML(gladeFile,"window1")
self.menuFichier=self.wTree.get_widget("menu1")
entree=gtk.MenuItem("some text")
self.menuFichier.insert(entree,5)

and I expect to see "some text" as the 6th entry in my menu when I drop it,
but it's not the case... the menu is not modified.

I'd like to be able to delete an entry I have created, but there is no
self.menuFichier.delete(n) method.

Any hints on this? Thanks !

-- 
Fabrice DELENTE


More information about the pygtk mailing list