本文整理汇总了Python中wx.Icon方法的典型用法代码示例。如果您正苦于以下问题:Python wx.Icon方法的具体用法?Python wx.Icon怎么用?Python wx.Icon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.Icon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def __init__(self):
wx.Frame.__init__(self, None,
pos=wx.DefaultPosition, size=wx.Size(450, 100),
style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION |
wx.CLOSE_BOX | wx.CLIP_CHILDREN,
title="BRUNO")
panel = wx.Panel(self)
ico = wx.Icon('boy.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(ico)
my_sizer = wx.BoxSizer(wx.VERTICAL)
lbl = wx.StaticText(panel,
label="Bienvenido Sir. How can I help you?")
my_sizer.Add(lbl, 0, wx.ALL, 5)
self.txt = wx.TextCtrl(panel, style=wx.TE_PROCESS_ENTER,
size=(400, 30))
self.txt.SetFocus()
self.txt.Bind(wx.EVT_TEXT_ENTER, self.OnEnter)
my_sizer.Add(self.txt, 0, wx.ALL, 5)
panel.SetSizer(my_sizer)
self.Show()
speak.Speak('''Welcome back Sir, Broono at your service.''')
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def __init__(self, parent):
super(Mainapp, self).__init__(parent)
self.resnet_model_loaded = False # Value to make checks, as the image prediction Model should loaded only once
self.model_collection_resnet = [] # An Array to hold the Loaded model for use for subsequent calls for image prediction
self.magic_collection = [] # A collection to hold the containing UI objects and its children
pub.subscribe(self.reportPrediction, "report101" ) # Subscribe the function to the call coming from the thread
# Set the User interface properties
self.Action()
self.SetBackgroundColour("green")
self.SetSize((1000,600))
self.SetTitle("RestNet Playground")
icon = wx.Icon("PROGRAM_INSTALL_FULLPATH\\playground.png")
self.SetIcon(icon)
self.Centre()
self.Show()
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def __init__(self, parent):
super(Mainapp, self).__init__(parent)
self.squeezenet_model_loaded = False # Value to make checks, as the image prediction Model should loaded only once
self.model_collection_squeezenet = [] # An Array to hold the Loaded model for use for subsequent calls for image prediction
self.magic_collection = [] # A collection to hold the containing UI objects and its children
pub.subscribe(self.reportPrediction, "report101" ) # Subscribe the function to the call coming from the thread
# Set the User interface properties
self.Action()
self.SetBackgroundColour("green")
self.SetSize((1000,600))
self.SetTitle("SqueezeNet Playground")
icon = wx.Icon("PROGRAM_INSTALL_FULLPATH\\playground.png")
self.SetIcon(icon)
self.Centre()
self.Show()
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def __init__(self, parent):
super(Mainapp, self).__init__(parent)
self.densenet_model_loaded = False # Value to make checks, as the image prediction Model should loaded only once
self.model_collection_densenet = [] # An Array to hold the Loaded model for use for subsequent calls for image prediction
self.magic_collection = [] # A collection to hold the containing UI objects and its children
pub.subscribe(self.reportPrediction, "report101" ) # Subscribe the function to the call coming from the thread
# Set the User interface properties
self.Action()
self.SetBackgroundColour("green")
self.SetSize((1000,600))
self.SetTitle("DenseNet Playground")
icon = wx.Icon("PROGRAM_INSTALL_FULLPATH\\playground.png")
self.SetIcon(icon)
self.Centre()
self.Show()
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def __init__(self, parent):
super(Mainapp, self).__init__(parent)
self.inception_model_loaded = False # Value to make checks, as the image prediction Model should loaded only once
self.model_collection_inception = [] # An Array to hold the Loaded model for use for subsequent calls for image prediction
self.magic_collection = [] # A collection to hold the containing UI objects and its children
pub.subscribe(self.reportPrediction, "report101" ) # Subscribe the function to the call coming from the thread
# Set the User interface properties
self.Action()
self.SetBackgroundColour("green")
self.SetSize((1000,600))
self.SetTitle("Inception Playground")
icon = wx.Icon("PROGRAM_INSTALL_FULLPATH\\playground.png")
self.SetIcon(icon)
self.Centre()
self.Show()
示例6: OnAbout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def OnAbout(self, evt):
"""About GoSync"""
if wxgtk4 :
about = wx.adv.AboutDialogInfo()
else:
about = wx.AboutDialogInfo()
about.SetIcon(wx.Icon(ABOUT_ICON, wx.BITMAP_TYPE_PNG))
about.SetName(APP_NAME)
about.SetVersion(APP_VERSION)
about.SetDescription(APP_DESCRIPTION)
about.SetCopyright(APP_COPYRIGHT)
about.SetWebSite(APP_WEBSITE)
about.SetLicense(APP_LICENSE)
about.AddDeveloper(APP_DEVELOPER)
about.AddArtist(ART_DEVELOPER)
if wxgtk4 :
wx.adv.AboutBox(about)
else:
wx.AboutBox(about)
示例7: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [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())
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [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()
示例9: layoutComponent
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def layoutComponent(self):
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.header, 0, wx.EXPAND)
sizer.Add(wx_util.horizontal_rule(self), 0, wx.EXPAND)
sizer.Add(self.navbar, 1, wx.EXPAND)
sizer.Add(self.console, 1, wx.EXPAND)
sizer.Add(wx_util.horizontal_rule(self), 0, wx.EXPAND)
sizer.Add(self.footer, 0, wx.EXPAND)
self.SetMinSize((400, 300))
self.SetSize(self.buildSpec['default_size'])
self.SetSizer(sizer)
self.console.Hide()
self.Layout()
if self.buildSpec.get('fullscreen', True):
self.ShowFullScreen(True)
# Program Icon (Windows)
icon = wx.Icon(self.buildSpec['images']['programIcon'], wx.BITMAP_TYPE_PNG)
self.SetIcon(icon)
if sys.platform != 'win32':
# OSX needs to have its taskbar icon explicitly set
# bizarrely, wx requires the TaskBarIcon to be attached to the Frame
# as instance data (self.). Otherwise, it will not render correctly.
self.taskbarIcon = TaskBarIcon(iconType=wx.adv.TBI_DOCK)
self.taskbarIcon.SetIcon(icon)
示例10: OnInit
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def OnInit(self):
self.running = True
if profile:
try:
os.unlink(prof_file_name)
except:
pass
self.prof = Profiler()
self.prof.enable()
wx.the_app = self
self._DoIterationId = wx.NewEventType()
self.Connect(-1, -1, self._DoIterationId, self._doIteration)
self.evt = wx.PyEvent()
self.evt.SetEventType(self._DoIterationId)
self.event_queue = []
# this breaks TreeListCtrl, and I'm too lazy to figure out why
#wx.IdleEvent_SetMode(wx.IDLE_PROCESS_SPECIFIED)
# this fixes 24bit-color toolbar buttons
wx.SystemOptions_SetOptionInt("msw.remap", 0)
icon_path = os.path.join(image_root, 'bittorrent.ico')
self.icon = wx.Icon(icon_path, wx.BITMAP_TYPE_ICO)
return True
示例11: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def __init__(self):
'''
@summary: Constructor
@param config_dict: The build configuration, if present
@param load_config: Handle to a config loader method/object
'''
self.language = DEFAULT_LANGUAGE
self.__builder = None
self.config_file_path = None
# Init super - MainFrame
MainFrame.__init__( self, parent=None )
self.console = Console(self.ConsoleTextCtrl)
self.StatusBar.SetStatusText("Ready...")
icon = wx.Icon()
icon.CopyFromBitmap(wx.Bitmap(os.path.join(self.__get_resources_path(), "builder_logo.bmp"), wx.BITMAP_TYPE_ANY))
self.SetIcon(icon)
# Update GUI Visuals
self.update_gui_visuals()
# Set initial event handlers
self.set_events()
示例12: OnAboutClick
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def OnAboutClick(self, event=None):
info = wx.adv.AboutDialogInfo()
info.SetName('RS485 MODBUS GUI')
info.SetVersion('v{}'.format(relay_boards.VERSION))
info.SetCopyright('(C) 2018 by Erriez')
ico_path = resource_path('images/R421A08.ico')
if os.path.exists(ico_path):
info.SetIcon(wx.Icon(ico_path))
info.SetDescription(wordwrap(
"This is an example application to control a R421A08 relay board using wxPython!",
350, wx.ClientDC(self)))
info.SetWebSite(SOURCE_URL,
"Source & Documentation")
info.AddDeveloper('Erriez')
info.SetLicense(wordwrap("MIT License: Completely and totally open source!", 500,
wx.ClientDC(self)))
wx.adv.AboutBox(info)
# --------------------------------------------------------------------------------------------------
# Relay panel
# --------------------------------------------------------------------------------------------------
示例13: OnMenuAbout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def OnMenuAbout(self, event):
"""
Display an About Dialog
:param event:
:return:
"""
info = wx.adv.AboutDialogInfo()
info.SetName('RS485 MODBUS GUI')
info.SetVersion('v{}'.format(relay_modbus.VERSION))
info.SetCopyright('(C) 2018 by Erriez')
ico_path = resource_path('images/modbus.ico')
if os.path.exists(ico_path):
info.SetIcon(wx.Icon(ico_path))
info.SetDescription(wordwrap(
"This is an example application to monitor and send MODBUS commands using wxPython!",
350, wx.ClientDC(self)))
info.SetWebSite("https://github.com/Erriez/R421A08-rs485-8ch-relay-board",
"Source & Documentation")
info.AddDeveloper('Erriez')
info.SetLicense(wordwrap("MIT License: Completely and totally open source!", 500,
wx.ClientDC(self)))
# Then we call wx.AboutBox giving it that info object
wx.adv.AboutBox(info)
示例14: _init_properties
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def _init_properties(self):
# self.SetTitle(self.build_spec['program_name'])
# self.SetSize(self.build_spec['default_size'])
# # self.SetMinSize((400, 300))
self.icon = wx.Icon(image_repository.program_icon, wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)
示例15: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import Icon [as 别名]
def __init__(self):
self.option=sys.argv[1]
self.text_sms=sys.argv[2]
self.text_sms=unicode(self.text_sms,'utf-8')
self.phone=sys.argv[3]
self.conf = Conf()
self.home = self.conf.home
self.currentpath = self.home+self.conf.get('GENERAL', 'op_folder')+'/openplotter'
Language(self.conf)
wx.Frame.__init__(self, None, title=_('Test SMS'), size=(500,260))
self.SetFont(wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
self.icon = wx.Icon(self.currentpath+'/openplotter.ico', wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)
self.CreateStatusBar()
self.text=wx.StaticText(self, label=_('Error'), pos=(10, 10))
self.output = wx.TextCtrl(self, style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_DONTWRAP, size=(480,110), pos=(10,50))
self.button_close =wx.Button(self, label=_('Close'), pos=(300, 170))
self.Bind(wx.EVT_BUTTON, self.close, self.button_close)
self.button_calculate =wx.Button(self, label=_('Start'), pos=(400, 170))
self.Bind(wx.EVT_BUTTON, self.calculate, self.button_calculate)
if self.option=='i':
self.text.SetLabel(_('Press start to check the settings and connect to the GSM device'))
if self.option=='t':
self.text.SetLabel(_('Press start to send the text "').decode('utf8')+self.text_sms+_('"\nto the number "').decode('utf8')+self.phone+'"')
self.Centre()