Changeset bfa73ca in sasview


Ignore:
Timestamp:
Mar 4, 2011 10:13:12 AM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
5ef55d2
Parents:
cc061c3
Message:

update console of statusbar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/gui_statusbar.py

    r010c251 rbfa73ca  
    22from wx import StatusBar as wxStatusB 
    33from wx.lib import newevent 
    4 (MessageEvent, EVT_MESSAGE) = newevent.NewEvent() 
     4 
    55#numner of fields of the status bar  
    66NB_FIELDS = 4 
     
    4747        self.panel = ConsolePanel(self) 
    4848        self.panel.set_message(status=status) 
    49         self.Bind(EVT_MESSAGE, self.set_message) 
     49        wx.EVT_CLOSE(self, self.Close) 
    5050        self.Show(True) 
    5151         
     
    5757                self.panel.set_message(status) 
    5858                 
    59     def set_message(self, event): 
    60         """ 
    61         """ 
    62         self.panel.set_message(event.status) 
     59    def set_message(self, message): 
     60        """ 
     61        """ 
     62        self.panel.set_message(str(message)) 
     63         
     64    def Close(self, event): 
     65        """ 
     66        """ 
     67        self.Hide() 
    6368         
    6469class StatusBar(wxStatusB): 
     
    9499        self.bitmap_bt_console.Bind(wx.EVT_BUTTON, self._onMonitor, 
    95100                                            id=self.bitmap_bt_console.GetId()) 
     101         
    96102        self.reposition() 
    97103        ## Current progress value of the bar  
     
    101107        self.frame = None 
    102108        self.list_msg = [] 
     109        self.frame = Console(parent=self) 
     110        self.frame.set_multiple_messages(self.list_msg) 
     111        self.frame.Hide() 
    103112        self.progress = 0       
    104113        self.timer = wx.Timer(self, -1)  
     
    145154        icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR) 
    146155        self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 
    147         try: 
    148             if self.frame is not None and self.frame.IsShown(): 
    149                 event = MessageEvent() 
    150                 event.status = text 
    151                 wx.PostEvent(self.frame, event) 
    152         except: 
    153             return 
    154              
     156       
     157        if self.frame is not None : 
     158            self.frame.set_message(text) 
     159         
    155160    def PopStatusText(self, *args, **kwds): 
    156161        """ 
     
    234239        if hasattr(event, "status"): 
    235240            self.SetStatusText(str(event.status)) 
    236              
     241        
     242  
    237243    def set_gauge(self, event): 
    238244        """ 
     
    286292        Pop up a frame with messages sent to the status bar 
    287293        """ 
    288         self.frame = Console(parent=self) 
    289         self.frame.set_multiple_messages(self.list_msg) 
    290294        self.frame.Show(True) 
    291295         
Note: See TracChangeset for help on using the changeset viewer.