Mercurial > libervia-backend
comparison frontends/wix/main_window.py @ 11:37153f3a3dc1
wix: Tray Icon
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 27 Oct 2009 01:21:35 +0100 |
parents | a06a151fc31f |
children | 6928e3cb73a8 |
comparison
equal
deleted
inserted
replaced
10:14d7861ca59e | 11:37153f3a3dc1 |
---|---|
177 self.statusTxt=wx.TextCtrl(self.tools, -1, style = wx.TE_PROCESS_ENTER) | 177 self.statusTxt=wx.TextCtrl(self.tools, -1, style = wx.TE_PROCESS_ENTER) |
178 self.tools.AddControl(self.statusTxt) | 178 self.tools.AddControl(self.statusTxt) |
179 self.Bind(wx.EVT_COMBOBOX, self.onStatusChange, self.statusBox) | 179 self.Bind(wx.EVT_COMBOBOX, self.onStatusChange, self.statusBox) |
180 self.Bind(wx.EVT_TEXT_ENTER, self.onStatusChange, self.statusTxt) | 180 self.Bind(wx.EVT_TEXT_ENTER, self.onStatusChange, self.statusTxt) |
181 self.tools.Disable() | 181 self.tools.Disable() |
182 | |
183 #tray icon | |
184 ticon = wx.Icon("images/tray_icon.xpm", wx.BITMAP_TYPE_XPM) | |
185 self.tray_icon = wx.TaskBarIcon() | |
186 self.tray_icon.SetIcon(ticon, "Wix jabber client") | |
187 wx.EVT_TASKBAR_LEFT_UP(self.tray_icon, self.onTrayClick) | |
188 | |
182 | 189 |
183 #events | 190 #events |
184 self.Bind(wx.EVT_CLOSE, self.onClose, self) | 191 self.Bind(wx.EVT_CLOSE, self.onClose, self) |
185 | 192 |
186 QuickApp.__init__(self) | 193 QuickApp.__init__(self) |
378 dlg.Destroy() | 385 dlg.Destroy() |
379 | 386 |
380 def onClose(self, e): | 387 def onClose(self, e): |
381 info("Exiting...") | 388 info("Exiting...") |
382 e.Skip() | 389 e.Skip() |
383 | 390 |
391 def onTrayClick(self, e): | |
392 debug("Tray Click") | |
393 if self.IsShown(): | |
394 self.Hide() | |
395 else: | |
396 self.Show() | |
397 self.Raise() | |
398 e.Skip() | |
399 |