ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change
on this file since 853cb6d was
aa4b8379,
checked in by Mathieu Doucet <doucetm@…>, 16 years ago
|
Updated for interactive graphs. Improved for standalone use.
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[aa4b8379] | 1 | import wx |
---|
[f3d51f6] | 2 | #import gui_manager |
---|
| 3 | from sans.guiframe import gui_manager |
---|
[4a5de6f] | 4 | |
---|
| 5 | # For py2exe, import config here |
---|
| 6 | import local_config |
---|
[aa4b8379] | 7 | from perspectives.pr.pr import NewPrFileEvent |
---|
| 8 | |
---|
| 9 | class PrFrame(gui_manager.ViewerFrame): |
---|
| 10 | def _on_open(self, event): |
---|
| 11 | wx.PostEvent(self, NewPrFileEvent()) |
---|
| 12 | |
---|
| 13 | class PrApp(gui_manager.ViewApp): |
---|
| 14 | def OnInit(self): |
---|
| 15 | #from gui_manager import ViewerFrame |
---|
| 16 | self.frame = PrFrame(None, -1, local_config.__appname__) |
---|
| 17 | self.frame.Show(True) |
---|
[4a5de6f] | 18 | |
---|
[aa4b8379] | 19 | if hasattr(self.frame, 'special'): |
---|
| 20 | print "Special?", self.frame.special.__class__.__name__ |
---|
| 21 | self.frame.special.SetCurrent() |
---|
| 22 | self.SetTopWindow(self.frame) |
---|
| 23 | return True |
---|
| 24 | |
---|
[f3d51f6] | 25 | class SansView(): |
---|
| 26 | |
---|
| 27 | def __init__(self): |
---|
| 28 | """ |
---|
| 29 | |
---|
| 30 | """ |
---|
| 31 | #from gui_manager import ViewApp |
---|
[aa4b8379] | 32 | #self.gui = gui_manager.ViewApp(0) |
---|
| 33 | self.gui = PrApp(0) |
---|
[f3d51f6] | 34 | |
---|
[4a5de6f] | 35 | # Add perspectives to the basic application |
---|
| 36 | # Additional perspectives can still be loaded |
---|
| 37 | # dynamically |
---|
| 38 | import perspectives.pr as module |
---|
[aa4b8379] | 39 | self.pr_plug = module.Plugin() |
---|
| 40 | self.gui.add_perspective(self.pr_plug) |
---|
[4a5de6f] | 41 | |
---|
| 42 | # Build the GUI |
---|
| 43 | self.gui.build_gui() |
---|
| 44 | |
---|
[f3d51f6] | 45 | # Set the application manager for the GUI |
---|
| 46 | self.gui.set_manager(self) |
---|
| 47 | |
---|
| 48 | # Start the main loop |
---|
| 49 | self.gui.MainLoop() |
---|
[aa4b8379] | 50 | |
---|
[f3d51f6] | 51 | |
---|
| 52 | if __name__ == "__main__": |
---|
| 53 | sansview = SansView() |
---|
Note: See
TracBrowser
for help on using the repository browser.