Python wx.IconBundle() Examples

The following are 9 code examples of wx.IconBundle(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module wx , or try the search function .
Example #1
Source File: backend_wx.py    From GraphicDesignPatternByPython with MIT License 6 votes vote down vote up
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) 
Example #2
Source File: systray.py    From p2ptv-pi with MIT License 6 votes vote down vote up
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()) 
Example #3
Source File: trelby.py    From trelby with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #4
Source File: backend_wx.py    From Mastering-Elasticsearch-7.0 with MIT License 5 votes vote down vote up
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) 
Example #5
Source File: backend_wx.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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) 
Example #6
Source File: createlivestream_wx.py    From p2ptv-pi with MIT License 5 votes vote down vote up
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()) 
Example #7
Source File: backend_wx.py    From coffeegrindsize with MIT License 5 votes vote down vote up
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) 
Example #8
Source File: backend_wx.py    From CogAlg with MIT License 5 votes vote down vote up
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) 
Example #9
Source File: elecsus_gui.py    From ElecSus with Apache License 2.0 4 votes vote down vote up
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)