[pygtk] Adding and deleting items from a menu

Alessandro Dentella sandro at e-den.it
Mon Aug 17 17:38:41 WST 2009


On Mon, Aug 17, 2009 at 10:54:06AM +0200, Fabrice DELENTE wrote:
> 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 !


This is not a real answer to your question, but I have been fighting with
menus till I took the time to read UIManager Interfaces that really makes
working with menus much simpler and more reasonable.

sandro
*:-)


More information about the pygtk mailing list