/[thuban]/trunk/thuban/Examples/simple_extensions/simple_command.py
ViewVC logotype

Diff of /trunk/thuban/Examples/simple_extensions/simple_command.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 208 by bh, Tue Jul 9 14:57:03 2002 UTC revision 224 by bh, Thu Jul 18 13:04:06 2002 UTC
# Line 17  from Thuban.UI.command import registry, Line 17  from Thuban.UI.command import registry,
17  import Thuban.UI.mainwindow  import Thuban.UI.mainwindow
18    
19  # a function implementing a command. Such a function is called with one  # a function implementing a command. Such a function is called with one
20  # argument describing the context in which it is invoked. Currently the  # argument describing the context in which it is invoked. The context is
21  # context is the mainwindow object.  # an object with a few public attributes for the application object, the
22    # session and the main window.
23  def simple_command(context):  def simple_command(context):
24      print "simple_command: Main window", context      print "simple_command: Application", context.application
25      print "simple_command: Map", context.canvas.Map()      print "simple_command: Session", context.session
26        print "simple_command: Main window", context.mainwindow
27        print "simple_command: Map", context.mainwindow.canvas.Map()
28    
29  # Add the command to the registry. A command is represented by a Command  # Add the command to the registry. A command is represented by a Command
30  # instance which is instantiated with four parameters here, the name of  # instance which is instantiated with four parameters here, the name of

Legend:
Removed from v.208  
changed lines
  Added in v.224

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26