jan: thuban/Examples/simple_extensions simple_command.py,1.2,1.3
cvs@intevation.de
cvs at intevation.de
Sat Nov 20 22:57:45 CET 2004
Author: jan
Update of /thubanrepository/thuban/Examples/simple_extensions
In directory doto:/tmp/cvs-serv9691
Modified Files:
simple_command.py
Log Message:
Some more comments, minor changes.
Index: simple_command.py
===================================================================
RCS file: /thubanrepository/thuban/Examples/simple_extensions/simple_command.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- simple_command.py 18 Jul 2002 13:04:06 -0000 1.2
+++ simple_command.py 20 Nov 2004 21:57:43 -0000 1.3
@@ -1,6 +1,7 @@
-# Copyright (C) 2002 by Intevation GmbH
+# Copyright (C) 2002, 2004 by Intevation GmbH
# Authors:
-# Bernhard Herzog <bh at intevation.de>
+# Bernhard Herzog <bh at intevation.de> (2002)
+# Jan-Oliver Wagner <jan at intevation.de> (2004)
#
# This program is free software under the GPL (>=v2)
# Read the file COPYING coming with Thuban for details.
@@ -10,11 +11,13 @@
"""
__version__ = "$Revision$"
+# $Source$
+# $Id$
# First import some things we need later.
import os
from Thuban.UI.command import registry, Command
-import Thuban.UI.mainwindow
+from Thuban.UI.mainwindow import main_menu
# a function implementing a command. Such a function is called with one
# argument describing the context in which it is invoked. The context is
@@ -40,11 +43,13 @@
# Thuban.UI.mainwindow. This object has a few methods to add new menus
# and menu items.
#
-# InsertMenu creates a new submenu in the menu, parameters are its name
+# FindOrInsertMenu creates a new submenu in the menu, parameters are its name
# and title which have the same meanings as for a command. The return
# value is a menu object for the new submenu which has the same methods
# as main_menu.
-menu = Thuban.UI.mainwindow.main_menu.InsertMenu("examples", "&Examples")
+# If the menu already exist, this previous one will be returned an
+# no new one be created.
+menu = main_menu.FindOrInsertMenu("examples", "&Examples")
# In the new menu we can add new items with InsertItem which takes the
# name of a command as parameter or with InsertSeparator to add a
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)