from __future__ import (
with_statement,
division,
print_function,
)
import wx
class Frame(wx.Frame):
def __init__(self, parent=None):
wx.Frame.__init__(self, parent)
self.ico = wx.Icon("dw.ico", wx.BITMAP_TYPE_ICO)
self.tb_ico=wx.TaskBarIcon()
self.tb_ico.SetIcon(self.ico, u"tips comment")
self.tb_ico.Bind(wx.EVT_TASKBAR_LEFT_UP, self.OnTbiLeftUp)
self.tb_ico.Bind(wx.EVT_TASKBAR_RIGHT_DCLICK, self.OnTbiRightDClicked)
self.Bind(wx.EVT_ICONIZE, self.OnIconized)
def OnIconized(self, evt):
self.Hide()
self.tb_ico.SetIcon(self.ico, u"tips comment")
def OnTbiRightDClicked(self, evt):
self.tb_ico.RemoveIcon()
wx.GetApp().ExitMainLoop()
def OnTbiLeftUp(self, evt):
self.Iconize(False)
self.Show(True)
self.Raise()
self.tb_ico.RemoveIcon()
def main():
app = wx.PySimpleApp()
f = Frame()
f.Hide()
app.SetTopWindow(f)
app.MainLoop()
if __name__ == "__main__":
main()