source: sasview/sansview/sansview.py @ 5612152

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 5612152 was 57acd41, checked in by Mathieu Doucet <doucetm@…>, 15 years ago

sansview: added size parameters

  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[d89f09b]1import wx
2#import gui_manager
3from sans.guiframe import gui_manager
4
5# For py2exe, import config here
6import local_config
[9f73a1d]7import logging
[d89f09b]8
[57acd41]9# Application dimensions
10APP_HEIGHT = 800
11APP_WIDTH  = 1000
12
13class 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
[2d39535]24
[d89f09b]25class SansView():
26   
27    def __init__(self):
28        """
29       
30        """
31        #from gui_manager import ViewApp
[57acd41]32        self.gui = SansViewApp(0) 
[d89f09b]33       
34        # Add perspectives to the basic application
35        # Additional perspectives can still be loaded
36        # dynamically
[365a17f6]37        # Note: py2exe can't find dynamically loaded
38        # modules. We load the fitting module here
39        # to ensure a complete Windows executable build.
[2d39535]40
[1c8015f]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
[2d39535]49        # Fitting perspective
[365a17f6]50        import perspectives.fitting as module   
51        fitting_plug = module.Plugin()
52        self.gui.add_perspective(fitting_plug)
[e5c6fff]53     
[d89f09b]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
64if __name__ == "__main__": 
65    sansview = SansView()
Note: See TracBrowser for help on using the repository browser.