本文整理汇总了Python中tkinter.Tk.wm_iconbitmap方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.wm_iconbitmap方法的具体用法?Python Tk.wm_iconbitmap怎么用?Python Tk.wm_iconbitmap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Tk
的用法示例。
在下文中一共展示了Tk.wm_iconbitmap方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_iconbitmap [as 别名]
def main():
''' Runs main application GUI.
'''
logger = get_logger()
logger.info('pyDEA started as a GUI application.')
root = Tk()
root.report_callback_exception = show_error
# load logo
if "nt" == os.name:
iconfile = pkg_resources.resource_filename(PACKAGE, 'pyDEAlogo.ico')
root.wm_iconbitmap(bitmap=iconfile)
else:
iconfile = pkg_resources.resource_filename(PACKAGE, 'pyDEAlogo.gif')
img = PhotoImage(file=iconfile)
root.tk.call('wm', 'iconphoto', root._w, img)
# change background color of all widgets
s = Style()
s.configure('.', background=bg_color)
# run the application
app = MainFrame(root)
root.protocol("WM_DELETE_WINDOW", (lambda: ask_quit(app)))
center_window(root,
root.winfo_screenwidth() - root.winfo_screenwidth()*0.15,
root.winfo_screenheight() - root.winfo_screenheight()*0.15)
root.mainloop()
logger.info('pyDEA exited.')
示例2: editSettings
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_iconbitmap [as 别名]
def editSettings(cls):
def commitSettings(messageInDialogIn):
try:
SettingsVars.DEFAULT_BOARD = defaultBoardBox.get()
SettingsVars.REFRESH_INTERVAL = int(refreshIntervalBox.get())
messageInDialogIn.destroy()
except ValueError:
messagebox.showwarning(message="Invalid Settings")
messageInDialogIn.focus_force()
settingsDialog = Tk()
settingsDialog.title('Settings')
try:
if os.name == "nt":
settingsDialog.wm_iconbitmap(bitmap='./gui/images/icon.ico')
except _tkinter.TclError:
pass
settingsDialog.columnconfigure(0, weight=1)
settingsDialog.rowconfigure(0, weight=1)
settingsDialog.minsize(width=100, height=50)
frame = Frame(settingsDialog)
refreshIntervalLabel = Label(frame)
refreshIntervalLabel['text'] = 'Refresh Interval'
refreshIntervalLabel.pack()
refreshIntervalBox = Entry(frame)
refreshIntervalBox.insert(0, cls.REFRESH_INTERVAL)
refreshIntervalBox.pack(fill='both')
defaultBoardLabel = Label(frame)
defaultBoardLabel['text'] = 'Default Board'
defaultBoardLabel.pack()
defaultBoardBox = Entry(frame)
defaultBoardBox.insert(0, cls.DEFAULT_BOARD)
defaultBoardBox.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
示例3: ConfigParser
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_iconbitmap [as 别名]
log_file_python = 'python.log'
log_file_client = 'client.log'
resources_dir = 'resources\\'
except AttributeError:
config_file = 'config.ini'
log_file_python = 'python.log'
log_file_client = 'client.log'
resources_dir = 'resources\\'
config = ConfigParser()
if config.read(config_file).__len__() < 1:
raise EnvironmentError
sys.stderr = open(log_file_python, 'w')
faulthandler.enable(open(log_file_python, 'w'))
logging.basicConfig(filename=log_file_client, level=config['CLIENT'].getint('log_level'))
root = Tk()
root.wm_title("Centurion Client")
icon = ''
system = platform.system()
if system == "Windows":
icon = 'centurion.ico'
elif system == "Linux":
icon = 'centurion.xbm'
root.wm_iconbitmap(root, resources_dir + 'images\\' + icon)
client = Client(root)
root.mainloop()
示例4: Tk
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_iconbitmap [as 别名]
__author__ = 'ToothlessRebel'
from tkinter import Tk
from client import Client
from pkg_resources import resource_filename
import faulthandler
faulthandler.enable(open('crash_log.txt', 'w'))
root = Tk()
root.wm_title("The Eternal City")
root.wm_iconbitmap(root, resource_filename('resources.images', 'eternal_logo.ico'))
client = Client(root)
root.mainloop()
示例5: Tk
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_iconbitmap [as 别名]
from tkinter import Tk
from client import Client
from pkg_resources import resource_filename
import faulthandler
import platform
__author__ = 'ToothlessRebel'
faulthandler.enable(open('crash_log.txt', 'w'))
root = Tk()
root.wm_title("Centurion Client")
icon = ''
system = platform.system()
if system == "Windows":
icon = 'centurion.ico'
elif system == "Linux":
icon = 'centurion.xbm'
root.wm_iconbitmap(root, resource_filename('resources.images', icon))
client = Client(root)
root.mainloop()
示例6:
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_iconbitmap [as 别名]
from tkinter import Tk
i=Tk()
i.title("Titulo do programa")
i.wm_iconbitmap("@icone.xbm")
i.geometry("800x600")
i.mainloop()
示例7: Tk
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_iconbitmap [as 别名]
"""
Special module used to ensure other modules use the same TK instance.
When Tk() is called, a toplevel window is generated for the application.
Putting this in a module ensures only one is ever created.
"""
from tkinter import Tk
import utils
TK_ROOT = Tk()
if utils.WIN:
# Ensure everything has our icon (including dialogs)
TK_ROOT.wm_iconbitmap(default='../BEE2.ico')
TK_ROOT.withdraw() # Hide the window until everything is loaded.