本文整理汇总了Python中Tkinter.Tk.wm_iconbitmap方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.wm_iconbitmap方法的具体用法?Python Tk.wm_iconbitmap怎么用?Python Tk.wm_iconbitmap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tkinter.Tk
的用法示例。
在下文中一共展示了Tk.wm_iconbitmap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_iconbitmap [as 别名]
def main():
root = Tk()
root.resizable(0,0)
root.wm_iconbitmap("bytecon.ico")
app = Application(root)
root.mainloop()
示例2: editSettings
# 需要导入模块: from Tkinter import Tk [as 别名]
# 或者: from Tkinter.Tk import wm_iconbitmap [as 别名]
def editSettings(cls):
def commitSettings(messageInDialogIn):
# Temp vars
ip = settings.serverIp
p = settings.port
settingsVars.serverIp = IPAddressBox.get()
settingsVars.port = portBox.get()
settingsVars.numberOfMessagesToGet = int(numberToGetBox.get())
settingsVars.refreshInterval = int(refreshIntervalBox.get())
if not cls.isServerActive():
settingsVars.serverIp = ip
settingsVars.port = p
tkMessageBox.showerror(message='Invalid Server Address ' + 'http://' + IPAddressBox.get() + ':' + portBox.get() + '/')
logging.warning('Invalid Server Address ' + 'http://' + IPAddressBox.get() + ':' + portBox.get() + '/')
messageInDialogIn.destroy()
settingsDialog = Tk()
settingsDialog.title('Settings')
if os.name == "nt":
settingsDialog.wm_iconbitmap(bitmap='images/icon.ico')
settingsDialog.columnconfigure(0, weight=1)
settingsDialog.rowconfigure(0, weight=1)
settingsDialog.minsize(width=100, height=50)
frame = Frame(settingsDialog)
addressLabel = Label(frame)
addressLabel['text'] = 'Server Address'
addressLabel.pack()
IPAddressBox = Entry(frame)
IPAddressBox.insert(0, cls.serverIp)
IPAddressBox.pack(fill='both')
portLabel = Label(frame)
portLabel['text'] = 'Server Port'
portLabel.pack()
portBox = Entry(frame)
portBox.insert(0, cls.port)
portBox.pack(fill='both')
numberToGetLabel = Label(frame)
numberToGetLabel['text'] = '# of Messages To Get'
numberToGetLabel.pack()
numberToGetBox = Entry(frame)
numberToGetBox.insert(0, cls.numberOfMessagesToGet)
numberToGetBox.pack(fill='both')
refreshIntervalLabel = Label(frame)
refreshIntervalLabel['text'] = 'Refresh Interval'
refreshIntervalLabel.pack()
refreshIntervalBox = Entry(frame)
refreshIntervalBox.insert(0, cls.refreshInterval)
refreshIntervalBox.pack(fill='both')
submitButton = Button(frame)
submitButton['text'] = 'Ok'
submitButton['command'] = lambda: commitSettings(settingsDialog)
submitButton.pack(side="left", expand="yes", fill="both", padx=5, pady=3)
cancelButton = Button(frame)
cancelButton['text'] = 'Cancel'
cancelButton['command'] = settingsDialog.destroy
cancelButton.pack(fill='both', expand="yes", padx=5, pady=3)
frame.pack(fill='both', expand="yes", padx=0, pady=0)
return settingsDialog