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 5068697 was
57acd41,
checked in by Mathieu Doucet <doucetm@…>, 16 years ago
|
sansview: added size parameters
|
-
Property mode set to
100644
|
File size:
1.9 KB
|
Line | |
---|
1 | import wx |
---|
2 | #import gui_manager |
---|
3 | from sans.guiframe import gui_manager |
---|
4 | |
---|
5 | # For py2exe, import config here |
---|
6 | import local_config |
---|
7 | import logging |
---|
8 | |
---|
9 | # Application dimensions |
---|
10 | APP_HEIGHT = 800 |
---|
11 | APP_WIDTH = 1000 |
---|
12 | |
---|
13 | class SansViewApp(gui_manager.ViewApp): |
---|
14 | def OnInit(self): |
---|
15 | #from gui_manager import ViewerFrame |
---|
16 | self.frame = gui_manager.ViewerFrame(None, -1, local_config.__appname__, |
---|
17 | window_height=APP_HEIGHT, window_width=APP_WIDTH) |
---|
18 | self.frame.Show(True) |
---|
19 | |
---|
20 | if hasattr(self.frame, 'special'): |
---|
21 | self.frame.special.SetCurrent() |
---|
22 | self.SetTopWindow(self.frame) |
---|
23 | return True |
---|
24 | |
---|
25 | class SansView(): |
---|
26 | |
---|
27 | def __init__(self): |
---|
28 | """ |
---|
29 | |
---|
30 | """ |
---|
31 | #from gui_manager import ViewApp |
---|
32 | self.gui = SansViewApp(0) |
---|
33 | |
---|
34 | # Add perspectives to the basic application |
---|
35 | # Additional perspectives can still be loaded |
---|
36 | # dynamically |
---|
37 | # Note: py2exe can't find dynamically loaded |
---|
38 | # modules. We load the fitting module here |
---|
39 | # to ensure a complete Windows executable build. |
---|
40 | |
---|
41 | # P(r) perspective |
---|
42 | try: |
---|
43 | import sans.perspectives.pr as module |
---|
44 | fitting_plug = module.Plugin(standalone=False) |
---|
45 | self.gui.add_perspective(fitting_plug) |
---|
46 | except: |
---|
47 | logging.error("SansView: could not find P(r) plug-in module") |
---|
48 | |
---|
49 | # Fitting perspective |
---|
50 | import perspectives.fitting as module |
---|
51 | fitting_plug = module.Plugin() |
---|
52 | self.gui.add_perspective(fitting_plug) |
---|
53 | |
---|
54 | # Build the GUI |
---|
55 | self.gui.build_gui() |
---|
56 | |
---|
57 | # Set the application manager for the GUI |
---|
58 | self.gui.set_manager(self) |
---|
59 | |
---|
60 | # Start the main loop |
---|
61 | self.gui.MainLoop() |
---|
62 | |
---|
63 | |
---|
64 | if __name__ == "__main__": |
---|
65 | sansview = SansView() |
---|
Note: See
TracBrowser
for help on using the repository browser.