source: sasview/simview/sansview.py @ d0abc8e

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

simview: initial import of simview perspective. Porting the old simview code to guiframe. [Imcomplete]

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[eaeb13e]1"""
2This software was developed by the University of Tennessee as part of the
3Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
4project funded by the US National Science Foundation.
5
6See the license text in license.txt
7
8copyright 2009, University of Tennessee
9"""
10import wx
11from sans.guiframe import gui_manager
12# For py2exe, import config here
13import local_config
14import logging
15
16# Application dimensions
17APP_HEIGHT = 800
18APP_WIDTH  = 1000
19
20class SansViewApp(gui_manager.ViewApp):
21    def OnInit(self):
22        screen_size = wx.GetDisplaySize()
23        app_height = APP_HEIGHT if screen_size[1]>APP_HEIGHT else screen_size[1]-50
24        app_width  = APP_WIDTH if screen_size[0]>APP_WIDTH else screen_size[0]-50
25
26        self.frame = gui_manager.ViewerFrame(None, -1, local_config.__appname__, 
27                             window_height=app_height, window_width=app_width)   
28        self.frame.Show(True)
29
30        if hasattr(self.frame, 'special'):
31            self.frame.special.SetCurrent()
32        self.SetTopWindow(self.frame)
33        return True
34
35class SansView():
36   
37    def __init__(self):
38        """
39            Initialize application
40        """
41        #from gui_manager import ViewApp
42        self.gui = SansViewApp(0) 
43       
44        # Add perspectives to the basic application
45        # Additional perspectives can still be loaded
46        # dynamically
47        # Note: py2exe can't find dynamically loaded
48        # modules. We load the fitting module here
49        # to ensure a complete Windows executable build.
50
51        # Simulation perspective
52        #import perspectives.simulation as module   
53        #self.gui.add_perspective(module.Plugin())
54     
55        # Build the GUI
56        self.gui.build_gui()
57       
58        # Set the application manager for the GUI
59        self.gui.set_manager(self)
60       
61        # Start the main loop
62        self.gui.MainLoop() 
63
64if __name__ == "__main__": 
65    sansview = SansView()
Note: See TracBrowser for help on using the repository browser.