wxpython最小化图标的创建

self.cpu["taskBarIcon"] = TaskBarIcon(self, self.cpu)

class TaskBarIcon(wx.TaskBarIcon):
    def __init__(self, frame, cpu):
        wx.TaskBarIcon.__init__(self)
        self.cpu = cpu
        self.frame = frame
        self.HasEvent = 0
        self.Blink = 0
        self.PageJump = 3
        self.menuBtn = self.cpu["Frame"].menuBtn
        self.menuBtnType = self.cpu["Handler"].menuBtnType
        self.SetIcon(wx.Icon(name='img/icon/csmart_32_32_100.ico', type=wx.BITMAP_TYPE_ICO), u'桌面版客户端!')
        #self.Bind(wx.EVT_TASKBAR_CLICK, self.OnTaskBarClick)
        self.Bind(wx.EVT_TASKBAR_LEFT_DOWN, self.OnTaskBarClick)

    def OnTaskBarClick(self, event):
        self.HasEvent = 0
        self.SetIcon(wx.Icon(name='img/icon/csmart_32_32_100.ico', type=wx.BITMAP_TYPE_ICO), u'桌面版客户端!')
        if self.frame.IsIconized():
           self.frame.Iconize(False)
        if not self.frame.IsShown():
           self.frame.Show(True)
        self.frame.Raise()

        if not self.menuBtn[self.menuBtnType[self.PageJump][0]].GetStatus():
            self.menuBtn[self.menuBtnType[self.PageJump][0]].SetToggle(1)
            for index in range(0,len(self.menuBtnType)):
                if (self.menuBtnType[index][0] != self.menuBtnType[self.PageJump][0]):
                    self.menuBtn[self.menuBtnType[index][0]].SetToggle(0) if self.menuBtn[self.menuBtnType[index][0]].GetStatus() else {}
            self.cpu["Frame"].CreatePage(self.menuBtnType[self.PageJump][0])

 

你可能感兴趣的:(wxpython最小化图标的创建)