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 |