source:
sasview/prview/sansview.py
@
793c988
Last change on this file since 793c988 was 0fdcd1e, checked in by Mathieu Doucet <doucetm@…>, 15 years ago | |
---|---|
|
|
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 | |
[0fdcd1e] | 7 | import sys |
[aa4b8379] | 8 | from perspectives.pr.pr import NewPrFileEvent |
9 | ||
[0fdcd1e] | 10 | # Application dimensions |
11 | APP_HEIGHT = 780 | |
12 | APP_WIDTH = 850 | |
[4318af7f] | 13 | |
[aa4b8379] | 14 | class PrFrame(gui_manager.ViewerFrame): |
15 | def _on_open(self, event): | |
16 | wx.PostEvent(self, NewPrFileEvent()) | |
17 | ||
18 | class PrApp(gui_manager.ViewApp): | |
19 | def OnInit(self): | |
20 | #from gui_manager import ViewerFrame | |
[2a92852] | 21 | self.frame = PrFrame(None, -1, local_config.__appname__, |
[0fdcd1e] | 22 | window_height=APP_HEIGHT, window_width=APP_WIDTH) |
[aa4b8379] | 23 | self.frame.Show(True) |
[4a5de6f] | 24 | |
[aa4b8379] | 25 | if hasattr(self.frame, 'special'): |
26 | self.frame.special.SetCurrent() | |
27 | self.SetTopWindow(self.frame) | |
28 | return True | |
29 | ||
[f3d51f6] | 30 | class SansView(): |
31 | ||
32 | def __init__(self): | |
33 | """ | |
34 | ||
35 | """ | |
36 | #from gui_manager import ViewApp | |
[aa4b8379] | 37 | #self.gui = gui_manager.ViewApp(0) |
38 | self.gui = PrApp(0) | |
[f3d51f6] | 39 | |
[4a5de6f] | 40 | # Add perspectives to the basic application |
41 | # Additional perspectives can still be loaded | |
42 | # dynamically | |
43 | import perspectives.pr as module | |
[ee6f84c] | 44 | self.pr_plug = module.Plugin(standalone=True) |
[aa4b8379] | 45 | self.gui.add_perspective(self.pr_plug) |
[4a5de6f] | 46 | |
47 | # Build the GUI | |
48 | self.gui.build_gui() | |
49 | ||
[f3d51f6] | 50 | # Set the application manager for the GUI |
51 | self.gui.set_manager(self) | |
52 | ||
53 | # Start the main loop | |
54 | self.gui.MainLoop() | |
[aa4b8379] | 55 | |
[f3d51f6] | 56 | |
57 | if __name__ == "__main__": | |
58 | sansview = SansView() |
Note: See TracBrowser
for help on using the repository browser.