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


Python wx.IconBundle方法代碼示例

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


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

示例1: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IconBundle [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

示例2: mySetIcons

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IconBundle [as 別名]
def mySetIcons(self):
        wx.Image_AddHandler(wx.PNGHandler())

        ib = wx.IconBundle()

        for sz in ("16", "32", "64", "128", "256"):
            ib.AddIcon(wx.IconFromBitmap(misc.getBitmap("resources/icon%s.png" % sz)))

        self.SetIcons(ib) 
開發者ID:trelby,項目名稱:trelby,代碼行數:11,代碼來源:trelby.py

示例3: _set_frame_icon

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IconBundle [as 別名]
def _set_frame_icon(frame):
    # set frame icon
    bundle = wx.IconBundle()
    for image in ('matplotlib.png', 'matplotlib_large.png'):
        image = os.path.join(matplotlib.rcParams['datapath'], 'images', image)
        if not os.path.exists(image):
            continue
        icon = wx.Icon(_load_bitmap(image))
        if not icon.IsOk():
            return
        bundle.AddIcon(icon)
    frame.SetIcons(bundle) 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:14,代碼來源:backend_wx.py

示例4: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IconBundle [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

示例5: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import IconBundle [as 別名]
def __init__(self,parent,title):
		""" Initialise main frame """
		wx.Frame.__init__(self,None,title=title,size=(2000,900))
		
		## EXPERIMENTAL
		#self._mgr = aui.AuiManager()
		#
		## notify AUI which frame to use
		#self._mgr.SetManagedWindow(self)

		#ubuntu sizing:
		if os.name == 'posix':
			font = wx.Font(9, wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL)
			self.SetFont(font)
		
		# Set icons for top-left of frame, alt-tab window ...
		frame_icon = wx.IconBundle()
		try:
			frame_icon.AddIconFromFile(os.path.join(elecsus_dir,'images/elecsus_t_group.ico'), wx.BITMAP_TYPE_ANY)
		except:
			# new wx version
			frame_icon.AddIcon(os.path.join(elecsus_dir,'images/elecsus_t_group.ico'), wx.BITMAP_TYPE_ANY)
		
		self.SetIcons(frame_icon)

		#if the window is closed, exit
		self.Bind(wx.EVT_CLOSE,self.OnExit)

		self.panel = wx.Panel(self)
		
		self.panel.SetBackgroundColour(wx.Colour(240,240,240))
		
		self._init_default_values()	
		self._init_plot_defaults()
		self._init_menus()
		self._init_panels()
		
		## redirect stdout (command line text) to status box
		sys.stdout = self.StatusPanel
		sys.stderr = self.ErrorPanel
		
		# Create initially blank set of axes
		#self.OnCreateAxes(self.figs[0],self.canvases[0])
		
		## Bind the event EVT_FIT_COMPLETE to function
		## This executes in the main thread once the fitting thread 
		## (separate from the main thread) completes
		self.Bind(EVT_FIT_COMPLETE,self.OnFitCompleted) 
開發者ID:jameskeaveney,項目名稱:ElecSus,代碼行數:50,代碼來源:elecsus_gui.py


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