extensions/experimental menu

Jan-Oliver Wagner jan at intevation.de
Sun May 2 14:08:47 CEST 2004


On Thu, Apr 22, 2004 at 07:27:10PM +0200, Bernhard Herzog wrote:
> > # find the extensions menu (create it anew if not found)
> > extensions_menu = main_menu.find_menu('extensions')
> > if extensions_menu is None:
> >     extensions_menu = main_menu.InsertMenu('extensions', _('E&xtensions'))
> 
> We should add a function to Thuban.UI.mainwindow that returns the
> extensions menu after creating it if it doesn't exist yet.  This code
> has been duplicated in at least 5 extensions.

AFAIKS, we have another option:

Add a method FindOrInsert() for class Menu of Thuban.UI.menu 
which either finds and returns the menu or it creates it if not
found and then returns the newly created one.

What do you think of this?
I can easily implement this.

	Jan
-- 
Jan-Oliver Wagner               http://intevation.de/~jan/

Intevation GmbH	              	     http://intevation.de/
FreeGIS	                               http://freegis.org/




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)