本文整理汇总了Python中tkinter.Tk.wm_attributes方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.wm_attributes方法的具体用法?Python Tk.wm_attributes怎么用?Python Tk.wm_attributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.Tk
的用法示例。
在下文中一共展示了Tk.wm_attributes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_attributes [as 别名]
def main():
resolution = load_resolution()
root = Tk()
root.geometry(resolution)
root.wm_title('PiMenu')
if len(sys.argv) > 1 and sys.argv[1] == 'fs':
root.wm_attributes('-fullscreen', True)
app = PiMenu(root)
root.mainloop()
示例2: run_text_editor
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_attributes [as 别名]
def run_text_editor(filename):
root = Tk()
input_handler = user_input.user_input()
input_handler.start_instance(filename)
app = text_canvas.text_canvas(root, 12, input_handler, filename)
root.wm_attributes('-fullscreen', 1)
root.title('shim')
root.overrideredirect()
root.mainloop()
示例3: draw_gui
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_attributes [as 别名]
def draw_gui(self):
main = Tk()
main.title('KindleButler ' + __version__)
main.resizable(0, 0)
main.wm_attributes('-toolwindow', 1)
x = (main.winfo_screenwidth() - main.winfo_reqwidth()) / 2
y = (main.winfo_screenheight() - main.winfo_reqheight()) / 2
main.geometry('+%d+%d' % (x, y))
progressbar = ttk.Progressbar(orient='horizontal', length=200, mode='determinate')
progressbar.grid(row=0)
style = ttk.Style()
style.configure('BW.TLabel', foreground='red')
label = ttk.Label(style='BW.TLabel')
return main, progressbar, label
示例4: main
# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_attributes [as 别名]
def main():
root = Tk()
root.title("Paddle Game")
root.resizable(0, 0)
root.wm_attributes("-topmost", 1)
canvas = Canvas(root, width=500, height=400, bd=0, highlightthickness=0)
canvas.pack()
root.update()
paddle = Paddle(canvas, "blue")
ball = Ball(canvas, paddle, "red")
while True:
if not ball.hit_bottom:
ball.draw()
paddle.draw()
root.update_idletasks()
root.update()
time.sleep(0.01)