45 |
def OnInit(self): |
def OnInit(self): |
46 |
self.read_startup_files() |
self.read_startup_files() |
47 |
self.interactor = Interactor(None) |
self.interactor = Interactor(None) |
48 |
top = mainwindow.MainWindow(NULL, -1, self, self.interactor) |
top = self.CreateMainWindow() |
49 |
top.Show(true) |
top.Show(true) |
50 |
self.top = top |
self.top = top |
51 |
self.SetTopWindow(top) |
self.SetTopWindow(top) |
85 |
# There's no .thuban directory |
# There's no .thuban directory |
86 |
sys.stderr.write("No ~/.thuban directory\n") |
sys.stderr.write("No ~/.thuban directory\n") |
87 |
|
|
88 |
|
def CreateMainWindow(self): |
89 |
|
"""Create and return the main window for the application. |
90 |
|
|
91 |
|
Override this in subclasses to instantiate the Thuban mainwindow |
92 |
|
with different parameters or to use a different class for the |
93 |
|
main window. |
94 |
|
|
95 |
|
when this method is called by OnInit self.interactor (to be used |
96 |
|
for the interactor argument of the standard Thuban main window |
97 |
|
class) has already been instantiated. |
98 |
|
""" |
99 |
|
msg = ("This is the wxPython-based Graphical User Interface" |
100 |
|
" for exploring geographic data") |
101 |
|
return mainwindow.MainWindow(NULL, -1, "Thuban", self, self.interactor, |
102 |
|
initial_message = msg) |
103 |
|
|
104 |
def Session(self): |
def Session(self): |
105 |
"""Return the application's session object""" |
"""Return the application's session object""" |
106 |
return self.session |
return self.session |