254 | | self.tbicon = wx.TaskBarIcon() |
255 | | self.greenicon = wx.Icon(os.path.join(iconsdir, "pykoticon-green.ico"), \ |
256 | | wx.BITMAP_TYPE_ICO) |
257 | | self.redicon = wx.Icon(os.path.join(iconsdir, "pykoticon-red.ico"), \ |
258 | | wx.BITMAP_TYPE_ICO) |
259 | | self.tbicon.SetIcon(self.greenicon, "PyKotIcon") |
260 | | |
261 | | wx.EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarActivate) |
262 | | wx.EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarMenu) |
263 | | |
264 | | self.TBMENU_ABOUT = wx.NewId() |
265 | | self.TBMENU_RESTORE = wx.NewId() |
266 | | self.TBMENU_CLOSE = wx.NewId() |
267 | | wx.EVT_MENU(self.tbicon, self.TBMENU_ABOUT, \ |
268 | | self.OnAbout) |
269 | | wx.EVT_MENU(self.tbicon, self.TBMENU_RESTORE, \ |
270 | | self.OnTaskBarActivate) |
271 | | wx.EVT_MENU(self.tbicon, self.TBMENU_CLOSE, \ |
272 | | self.OnTaskBarClose) |
273 | | self.menu = wx.Menu() |
274 | | self.menu.Append(self.TBMENU_ABOUT, _("About")) |
275 | | self.menu.Append(self.TBMENU_CLOSE, _("Quit")) |
276 | | |
277 | | wx.EVT_ICONIZE(self, self.OnIconify) |
278 | | wx.EVT_CLOSE(self, self.OnClose) |
279 | | self.Show(True) |
280 | | self.Iconize() |
281 | | self.Hide() |
282 | | |
| 364 | |
| 365 | self.tbicon = wx.TaskBarIcon() |
| 366 | self.greenicon = wx.Icon(os.path.join(iconsdir, "pykoticon-green.ico"), \ |
| 367 | wx.BITMAP_TYPE_ICO) |
| 368 | self.redicon = wx.Icon(os.path.join(iconsdir, "pykoticon-red.ico"), \ |
| 369 | wx.BITMAP_TYPE_ICO) |
| 370 | self.tbicon.SetIcon(self.greenicon, "PyKotIcon") |
| 371 | |
| 372 | wx.EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarActivate) |
| 373 | wx.EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarMenu) |
| 374 | |
| 375 | self.TBMENU_ABOUT = wx.NewId() |
| 376 | self.TBMENU_RESTORE = wx.NewId() |
| 377 | self.TBMENU_CLOSE = wx.NewId() |
| 378 | wx.EVT_MENU(self.tbicon, self.TBMENU_ABOUT, \ |
| 379 | self.OnAbout) |
| 380 | wx.EVT_MENU(self.tbicon, self.TBMENU_RESTORE, \ |
| 381 | self.OnTaskBarActivate) |
| 382 | wx.EVT_MENU(self.tbicon, self.TBMENU_CLOSE, \ |
| 383 | self.OnTaskBarClose) |
| 384 | self.menu = wx.Menu() |
| 385 | self.menu.Append(self.TBMENU_ABOUT, _("About"), _("About this software")) |
| 386 | if options.allowquit : |
| 387 | self.menu.Append(self.TBMENU_CLOSE, _("Quit"), \ |
| 388 | _("Exit the application")) |
| 389 | wx.EVT_ICONIZE(self, self.OnIconify) |
| 390 | wx.EVT_CLOSE(self, self.OnClose) |
| 391 | self.Show(True) |
| 392 | self.Hide() |
| 393 | |
| 394 | self.quitEvent = threading.Event() |