Changeset bfa73ca in sasview
- Timestamp:
- Mar 4, 2011 10:13:12 AM (14 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/gui_statusbar.py
r010c251 rbfa73ca 2 2 from wx import StatusBar as wxStatusB 3 3 from wx.lib import newevent 4 (MessageEvent, EVT_MESSAGE) = newevent.NewEvent() 4 5 5 #numner of fields of the status bar 6 6 NB_FIELDS = 4 … … 47 47 self.panel = ConsolePanel(self) 48 48 self.panel.set_message(status=status) 49 self.Bind(EVT_MESSAGE, self.set_message)49 wx.EVT_CLOSE(self, self.Close) 50 50 self.Show(True) 51 51 … … 57 57 self.panel.set_message(status) 58 58 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() 63 68 64 69 class StatusBar(wxStatusB): … … 94 99 self.bitmap_bt_console.Bind(wx.EVT_BUTTON, self._onMonitor, 95 100 id=self.bitmap_bt_console.GetId()) 101 96 102 self.reposition() 97 103 ## Current progress value of the bar … … 101 107 self.frame = None 102 108 self.list_msg = [] 109 self.frame = Console(parent=self) 110 self.frame.set_multiple_messages(self.list_msg) 111 self.frame.Hide() 103 112 self.progress = 0 104 113 self.timer = wx.Timer(self, -1) … … 145 154 icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR) 146 155 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 155 160 def PopStatusText(self, *args, **kwds): 156 161 """ … … 234 239 if hasattr(event, "status"): 235 240 self.SetStatusText(str(event.status)) 236 241 242 237 243 def set_gauge(self, event): 238 244 """ … … 286 292 Pop up a frame with messages sent to the status bar 287 293 """ 288 self.frame = Console(parent=self)289 self.frame.set_multiple_messages(self.list_msg)290 294 self.frame.Show(True) 291 295
Note: See TracChangeset
for help on using the changeset viewer.