Changeset aa4b8379 in sasview for prview/sansview.py


Ignore:
Timestamp:
Jun 18, 2008 6:10:06 PM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
3fd1ebc
Parents:
4972de2
Message:

Updated for interactive graphs. Improved for standalone use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • prview/sansview.py

    r4a5de6f raa4b8379  
    1  
     1import wx 
    22#import gui_manager 
    33from sans.guiframe import gui_manager 
     
    55# For py2exe, import config here 
    66import local_config 
     7from perspectives.pr.pr import NewPrFileEvent 
    78 
     9class PrFrame(gui_manager.ViewerFrame): 
     10    def _on_open(self, event): 
     11        wx.PostEvent(self, NewPrFileEvent()) 
     12 
     13class PrApp(gui_manager.ViewApp): 
     14    def OnInit(self): 
     15        #from gui_manager import ViewerFrame 
     16        self.frame = PrFrame(None, -1, local_config.__appname__)     
     17        self.frame.Show(True) 
     18 
     19        if hasattr(self.frame, 'special'): 
     20            print "Special?", self.frame.special.__class__.__name__ 
     21            self.frame.special.SetCurrent() 
     22        self.SetTopWindow(self.frame) 
     23        return True 
     24     
    825class SansView(): 
    926     
     
    1330        """ 
    1431        #from gui_manager import ViewApp 
    15         self.gui = gui_manager.ViewApp(0) 
     32        #self.gui = gui_manager.ViewApp(0)  
     33        self.gui = PrApp(0) 
    1634         
    1735        # Add perspectives to the basic application 
     
    1937        # dynamically 
    2038        import perspectives.pr as module 
    21         plug = module.Plugin() 
    22         self.gui.add_perspective(plug) 
     39        self.pr_plug = module.Plugin() 
     40        self.gui.add_perspective(self.pr_plug) 
    2341             
    2442        # Build the GUI 
     
    3048        # Start the main loop 
    3149        self.gui.MainLoop()   
     50         
    3251 
    3352if __name__ == "__main__":  
Note: See TracChangeset for help on using the changeset viewer.