當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.TaskBarIcon方法代碼示例

本文整理匯總了Python中wx.TaskBarIcon方法的典型用法代碼示例。如果您正苦於以下問題:Python wx.TaskBarIcon方法的具體用法?Python wx.TaskBarIcon怎麽用?Python wx.TaskBarIcon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wx的用法示例。


在下文中一共展示了wx.TaskBarIcon方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import TaskBarIcon [as 別名]
def __init__(self, pyroserver):
                wx.TaskBarIcon.__init__(self)
                self.pyroserver = pyroserver
                # Set the image
                self.UpdateIcon(None)

                # bind some events
                self.Bind(wx.EVT_MENU, self.OnTaskBarStartPLC, id=self.TBMENU_START)
                self.Bind(wx.EVT_MENU, self.OnTaskBarStopPLC, id=self.TBMENU_STOP)
                self.Bind(wx.EVT_MENU, self.OnTaskBarChangeName, id=self.TBMENU_CHANGE_NAME)
                self.Bind(wx.EVT_MENU, self.OnTaskBarChangeInterface, id=self.TBMENU_CHANGE_INTERFACE)
                self.Bind(wx.EVT_MENU, self.OnTaskBarLiveShell, id=self.TBMENU_LIVE_SHELL)
                self.Bind(wx.EVT_MENU, self.OnTaskBarWXInspector, id=self.TBMENU_WXINSPECTOR)
                self.Bind(wx.EVT_MENU, self.OnTaskBarChangePort, id=self.TBMENU_CHANGE_PORT)
                self.Bind(wx.EVT_MENU, self.OnTaskBarChangeWorkingDir, id=self.TBMENU_CHANGE_WD)
                self.Bind(wx.EVT_MENU, self.OnTaskBarQuit, id=self.TBMENU_QUIT) 
開發者ID:thiagoralves,項目名稱:OpenPLC_Editor,代碼行數:18,代碼來源:Beremiz_service.py

示例2: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import TaskBarIcon [as 別名]
def __init__(self, wxapp, bgapp, iconfilename):
        wx.TaskBarIcon.__init__(self)
        self.bgapp = bgapp
        self.wxapp = wxapp
        self.icons = wx.IconBundle()
        self.icon = wx.Icon(iconfilename, wx.BITMAP_TYPE_ICO)
        self.icons.AddIcon(self.icon)
        self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.OnLeftClicked)
        if sys.platform != 'darwin':
            self.SetIcon(self.icon, self.bgapp.appname)
        else:
            menuBar = wx.MenuBar()
            filemenu = wx.Menu()
            item = filemenu.Append(-1, 'E&xit', 'Terminate the program')
            self.Bind(wx.EVT_MENU, self.OnExit, item)
            wx.App.SetMacExitMenuItemId(item.GetId()) 
開發者ID:alesnav,項目名稱:p2ptv-pi,代碼行數:18,代碼來源:systray.py

示例3: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import TaskBarIcon [as 別名]
def __init__(self, parent, MainFrame, workingdir):
        wx.TaskBarIcon.__init__(self)
        self.parentApp = parent
        self.MainFrame = MainFrame
        self.wx_id = wx.NewId()

        if ON_WINDOWS:
            icon_file = os.path.join(
                            os.path.abspath(workingdir),
                            'chronolapse.ico'
                        )
        else:
            icon_file = os.path.join(
                            os.path.abspath(workingdir),
                            'chronolapse_24.ico'
                        )
        self.SetIcon(wx.Icon(icon_file, wx.BITMAP_TYPE_ICO), 'Chronolapse')
        self.CreateMenu() 
開發者ID:collingreen,項目名稱:chronolapse,代碼行數:20,代碼來源:chronolapse.py

示例4: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import TaskBarIcon [as 別名]
def __init__(self, frame):
        wx.TaskBarIcon.__init__(self)
        self.frame = frame
        self.icon = get_taskbar_icon()
        self.timer = wx.Timer(self)
        self.timer.Start(REFRESH_RATE_MILLIS)
        self.is_paused = False
        self.SetIcon(self.icon, "GUIMiner")
        self.imgidx = 1
        self.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.on_taskbar_activate)
        self.Bind(wx.EVT_MENU, self.on_taskbar_activate, id=self.TBMENU_RESTORE)
        self.Bind(wx.EVT_MENU, self.on_taskbar_close, id=self.TBMENU_CLOSE)
        self.Bind(wx.EVT_MENU, self.on_pause, id=self.TBMENU_PAUSE)
        self.Bind(wx.EVT_TIMER, self.on_timer) 
開發者ID:theRealTacoTime,項目名稱:poclbm,代碼行數:16,代碼來源:guiminer.py

示例5: CreatePopupMenu

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import TaskBarIcon [as 別名]
def CreatePopupMenu(self):
        """Override from wx.TaskBarIcon. Creates the right-click menu."""
        menu = wx.Menu()
        menu.AppendCheckItem(self.TBMENU_PAUSE, _("Pause all"))
        menu.Check(self.TBMENU_PAUSE, self.is_paused)
        menu.Append(self.TBMENU_RESTORE, _("Restore"))
        menu.Append(self.TBMENU_CLOSE, _("Close"))
        return menu 
開發者ID:theRealTacoTime,項目名稱:poclbm,代碼行數:10,代碼來源:guiminer.py

示例6: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import TaskBarIcon [as 別名]
def __init__(self, wxapp, bgapp, iconfilename):
        wx.TaskBarIcon.__init__(self)
        self.bgapp = bgapp
        self.wxapp = wxapp
        self.icons = wx.IconBundle()
        self.icon = wx.Icon(iconfilename, wx.BITMAP_TYPE_ICO)
        self.icons.AddIcon(self.icon)
        if sys.platform != 'darwin':
            self.SetIcon(self.icon, self.bgapp.appname)
        else:
            menuBar = wx.MenuBar()
            filemenu = wx.Menu()
            item = filemenu.Append(-1, 'E&xit', 'Terminate the program')
            self.Bind(wx.EVT_MENU, self.OnExit, item)
            wx.App.SetMacExitMenuItemId(item.GetId()) 
開發者ID:alesnav,項目名稱:p2ptv-pi,代碼行數:17,代碼來源:createlivestream_wx.py

示例7: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import TaskBarIcon [as 別名]
def __init__(self, frame):
        wx.TaskBarIcon.__init__(self)
        self.frame = frame
        self._update_task = TaskSingleton()
        self.tooltip = None
        self.set_tooltip(app_name)

        self.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.OnTaskBarActivate)
        self.Bind(wx.EVT_MENU, self.Toggle, id=self.TBMENU_TOGGLE)
        self.Bind(wx.EVT_MENU, wx.the_app.quit, id=self.TBMENU_CLOSE) 
開發者ID:kenorb-contrib,項目名稱:BitTorrent,代碼行數:12,代碼來源:DownloadManager.py

示例8: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import TaskBarIcon [as 別名]
def __init__(self, frame):
        wx.TaskBarIcon.__init__(self)
        self.frame = frame

        # Set the image
        icon = self.MakeIcon(WXPdemo.GetImage())
        self.SetIcon(icon, "wxPython Demo")
        self.imgidx = 1

        # bind some events
        self.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.OnTaskBarActivate)
        self.Bind(wx.EVT_MENU, self.OnTaskBarActivate, id=self.TBMENU_RESTORE)
        self.Bind(wx.EVT_MENU, self.OnTaskBarClose, id=self.TBMENU_CLOSE) 
開發者ID:peckhams,項目名稱:topoflow,代碼行數:15,代碼來源:Dock_Bar_Example.py

示例9: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import TaskBarIcon [as 別名]
def __init__(self, show):
        self.stateIcons = (
            wx.Icon(join(eg.imagesDir, "Tray1.png"), wx.BITMAP_TYPE_PNG),
            wx.Icon(join(eg.imagesDir, "Tray3.png"), wx.BITMAP_TYPE_PNG),
            wx.Icon(join(eg.imagesDir, "Tray2.png"), wx.BITMAP_TYPE_PNG),
        )
        self.tooltip = eg.APP_NAME + " " + eg.Version.string
        wx.TaskBarIcon.__init__(self)
        # SetIcon *must* be called immediately after creation, as otherwise
        # it won't appear on Vista restricted user accounts. (who knows why?)
        if show:
            self.Show()
        self.currentEvent = None
        self.processingEvent = None
        self.currentState = 0
        self.reentrantLock = threading.Lock()
        eg.Bind("ProcessingChange", self.OnProcessingChange)
        menu = self.menu = wx.Menu()
        text = eg.text.MainFrame.TaskBarMenu
        menu.Append(ID_SHOW, text.Show)
        menu.Append(ID_HIDE, text.Hide)
        menu.AppendSeparator()
        menu.Append(ID_EXIT, text.Exit)
        self.Bind(wx.EVT_MENU, self.OnCmdShow, id=ID_SHOW)
        self.Bind(wx.EVT_MENU, self.OnCmdHide, id=ID_HIDE)
        self.Bind(wx.EVT_MENU, self.OnCmdExit, id=ID_EXIT)
        self.Bind(wx.EVT_TASKBAR_RIGHT_UP, self.OnTaskBarMenu)
        self.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.OnCmdShow) 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:30,代碼來源:TaskBarIcon.py

示例10: __call__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import TaskBarIcon [as 別名]
def __call__(self, hwnd = None):
        # Gather info about the target window
        hwnd = GetBestHwnd(hwnd)
        icon = GetHwndIcon(hwnd)
        title = unicode(GetWindowText(hwnd))

        # If valid, minimize target to the systray
        if hwnd in eg.WinApi.GetTopLevelWindowList(False) and isinstance(icon, wx._gdi.Icon):
            trayIcon = wx.TaskBarIcon()
            trayIcon.SetIcon(icon, title)
            self.plugin.iconDict[hwnd] = trayIcon

            def OnClick2():
                # Remove our tray icon and restore the window
                try:
                    BringHwndToFront(hwnd)
                    del self.plugin.iconDict[hwnd]
                except:
                    pass
                finally:
                    trayIcon.RemoveIcon()
                    trayIcon.Destroy()

            def OnClick(*dummyArgs):
                wx.CallAfter(OnClick2)

            trayIcon.Bind(wx.EVT_TASKBAR_LEFT_UP, OnClick)
            wx.CallAfter(ShowWindow, hwnd, 0) 
開發者ID:EventGhost,項目名稱:EventGhost,代碼行數:30,代碼來源:__init__.py


注:本文中的wx.TaskBarIcon方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。