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 2c0f2a5 was
4318af7f,
checked in by Mathieu Doucet <doucetm@…>, 16 years ago
|
Improvements for Mac
|
-
Property mode set to
100644
|
File size:
1.6 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 | |
---|
[4318af7f] | 9 | # OS-dependent preferred height |
---|
| 10 | #TODO: refactor this |
---|
| 11 | _DEFAULT_HEIGHT=650 |
---|
| 12 | import sys |
---|
| 13 | if sys.platform.count("darwin")>0: |
---|
| 14 | _DEFAULT_HEIGHT=720 |
---|
| 15 | |
---|
[aa4b8379] | 16 | class PrFrame(gui_manager.ViewerFrame): |
---|
| 17 | def _on_open(self, event): |
---|
| 18 | wx.PostEvent(self, NewPrFileEvent()) |
---|
| 19 | |
---|
| 20 | class PrApp(gui_manager.ViewApp): |
---|
| 21 | def OnInit(self): |
---|
| 22 | #from gui_manager import ViewerFrame |
---|
[2a92852] | 23 | self.frame = PrFrame(None, -1, local_config.__appname__, |
---|
[4318af7f] | 24 | window_height=_DEFAULT_HEIGHT, window_width=750) |
---|
[aa4b8379] | 25 | self.frame.Show(True) |
---|
[4a5de6f] | 26 | |
---|
[aa4b8379] | 27 | if hasattr(self.frame, 'special'): |
---|
| 28 | self.frame.special.SetCurrent() |
---|
| 29 | self.SetTopWindow(self.frame) |
---|
| 30 | return True |
---|
| 31 | |
---|
[f3d51f6] | 32 | class SansView(): |
---|
| 33 | |
---|
| 34 | def __init__(self): |
---|
| 35 | """ |
---|
| 36 | |
---|
| 37 | """ |
---|
| 38 | #from gui_manager import ViewApp |
---|
[aa4b8379] | 39 | #self.gui = gui_manager.ViewApp(0) |
---|
| 40 | self.gui = PrApp(0) |
---|
[f3d51f6] | 41 | |
---|
[4a5de6f] | 42 | # Add perspectives to the basic application |
---|
| 43 | # Additional perspectives can still be loaded |
---|
| 44 | # dynamically |
---|
| 45 | import perspectives.pr as module |
---|
[aa4b8379] | 46 | self.pr_plug = module.Plugin() |
---|
| 47 | self.gui.add_perspective(self.pr_plug) |
---|
[4a5de6f] | 48 | |
---|
| 49 | # Build the GUI |
---|
| 50 | self.gui.build_gui() |
---|
| 51 | |
---|
[f3d51f6] | 52 | # Set the application manager for the GUI |
---|
| 53 | self.gui.set_manager(self) |
---|
| 54 | |
---|
| 55 | # Start the main loop |
---|
| 56 | self.gui.MainLoop() |
---|
[aa4b8379] | 57 | |
---|
[f3d51f6] | 58 | |
---|
| 59 | if __name__ == "__main__": |
---|
| 60 | sansview = SansView() |
---|
Note: See
TracBrowser
for help on using the repository browser.