/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/application.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/application.py

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

revision 189 by bh, Tue May 28 12:39:17 2002 UTC revision 235 by bh, Tue Jul 23 10:56:29 2002 UTC
# Line 26  from Thuban.Model.load import load_sessi Line 26  from Thuban.Model.load import load_sessi
26  import view  import view
27  import tree  import tree
28  from interactor import Interactor  from interactor import Interactor
29  from mainwindow import MainWindow  import mainwindow
30    
31  from messages import SESSION_CHANGED  from messages import SESSION_CHANGED
32    
# Line 45  class ThubanApplication(wxApp, Publisher Line 45  class ThubanApplication(wxApp, Publisher
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(NULL, -1, 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)
# Line 85  class ThubanApplication(wxApp, Publisher Line 85  class ThubanApplication(wxApp, Publisher
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):
105            """Return the application's session object"""
106            return self.session
107    
108      def SetSession(self, session):      def SetSession(self, session):
109            """Make session the new session.
110    
111            Issue SESSION_CHANGED.
112            """
113          oldsession = self.session          oldsession = self.session
114          self.session = session          self.session = session
115          self.issue(SESSION_CHANGED)          self.issue(SESSION_CHANGED)

Legend:
Removed from v.189  
changed lines
  Added in v.235

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26