Changeset 17175ad in sasview


Ignore:
Timestamp:
Aug 5, 2011 2:48:37 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
ae3e17e
Parents:
9abd9a8
Message:

working standalone tool

File:
1 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/sansviewtool.py

    r3be3a80 r17175ad  
    1212import wx 
    1313from sans.guiframe import gui_manager 
     14 
    1415# For py2exe, import config here 
    1516import local_config 
    1617import logging 
    1718 
    18 # Application dimensions 
    19 APP_HEIGHT = 80 
    20 APP_WIDTH  = 360 
    21  
    2219class SansViewToolApp(gui_manager.ViewApp): 
    2320    """ 
    2421    """ 
    25     def OnInit(self): 
    26         """ 
    27         """ 
    28         screen_size = wx.GetDisplaySize() 
    29         app_height = APP_HEIGHT if screen_size[1]>APP_HEIGHT else screen_size[1]-50 
    30         app_width  = APP_WIDTH if screen_size[0]>APP_WIDTH else screen_size[0]-50 
    31  
    32         self.frame = gui_manager.ViewerFrame(None, -1, local_config.__appname__,  
    33                              window_height=app_height, window_width=app_width)   
    34  
    35         self.frame.Show(True) 
    36  
    37         if hasattr(self.frame, 'special'): 
    38             self.frame.special.SetCurrent() 
    39         self.SetTopWindow(self.frame) 
    40         return True 
    4122     
    4223    
    43  
    4424class SansViewTool(): 
    4525    """ 
     
    6242        #Calculator perspective    
    6343        try: 
    64             import perspectives.calculator as module     
    65             calculator_plug = module.Plugin(standalone=True) 
     44            import sans.perspectives.calculator as module     
     45            calculator_plug = module.Plugin(standalone=False) 
    6646            self.gui.add_perspective(calculator_plug) 
    6747        except: 
    68             logging.error("SansView: could not find Calculator plug-in module")  
     48            logging.error("SansView: could not find Calculator plug-in module") 
     49            logging.error(sys.exc_value)   
    6950         
    7051       
    7152        # Build the GUI 
    7253        self.gui.build_gui() 
    73  
     54         
    7455        # Start the main loop 
    75         self.gui.MainLoop()   
    76         
     56        self.gui.MainLoop()  
     57         
    7758 
    7859if __name__ == "__main__":  
Note: See TracChangeset for help on using the changeset viewer.