当前位置: 首页>>代码示例>>Python>>正文


Python Tk.wm_iconbitmap方法代码示例

本文整理汇总了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()
开发者ID:IRDeNial,项目名称:gBot,代码行数:8,代码来源:main.py

示例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
开发者ID:Jelloeater,项目名称:forgeLandWallGUI,代码行数:76,代码来源:settings.py


注:本文中的Tkinter.Tk.wm_iconbitmap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。