本文整理汇总了Python中tkinter.mainloop方法的典型用法代码示例。如果您正苦于以下问题:Python tkinter.mainloop方法的具体用法?Python tkinter.mainloop怎么用?Python tkinter.mainloop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter
的用法示例。
在下文中一共展示了tkinter.mainloop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def __init__(self):
self.root = tkinter.Tk()
self.root.title("Mandelbrot (Pyro multi CPU core version)")
canvas = tkinter.Canvas(self.root, width=res_x, height=res_y, bg="#000000")
canvas.pack()
self.img = tkinter.PhotoImage(width=res_x, height=res_y)
canvas.create_image((res_x/2, res_y/2), image=self.img, state="normal")
with locate_ns() as ns:
mandels = ns.yplookup(meta_any={"class:mandelbrot_calc_color"})
mandels = list(mandels.items())
print("{0} mandelbrot calculation servers found.".format(len(mandels)))
if not mandels:
raise ValueError("launch at least one mandelbrot calculation server before starting this")
self.mandels = [uri for _, (uri, meta) in mandels]
self.pool = futures.ThreadPoolExecutor(max_workers=len(self.mandels))
self.tasks = []
self.start_time = time.time()
for line in range(res_y):
self.tasks.append(self.calc_new_line(line))
self.root.after(100, self.draw_results)
tkinter.mainloop()
示例2: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def __init__(self, control, board):
self.control = control
if self.control.game_mode != 2:
self.can.bind('<Button-1>', self.control.callback)
self.lb = tkinter.Listbox(ChessView.root,selectmode="browse")
self.scr1 = tkinter.Scrollbar(ChessView.root)
self.lb.configure(yscrollcommand=self.scr1.set)
self.scr1['command'] = self.lb.yview
self.scr1.pack(side='right',fill="y")
self.lb.pack(fill="x")
self.lb.bind('<<ListboxSelect>>', self.printList) # Double- <Button-1>
self.board = board
self.last_text_x = 0
self.last_text_y = 0
self.print_text_flag = False
# def start(self):
# tkinter.mainloop()
示例3: start
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def start(self):
if self.control.game_mode == 2:
self.root.update()
time.sleep(self.control.delay)
while True:
game_end = self.control.game_mode_2()
self.root.update()
time.sleep(self.control.delay)
if game_end:
time.sleep(self.control.end_delay)
self.quit()
return
else:
tkinter.mainloop()
# self.root.mainloop()
# below added by Fei Li
示例4: __init__
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def __init__(self):
self.root = tkinter.Tk()
self.root.title("Mandelbrot (Single CPU core)")
canvas = tkinter.Canvas(self.root, width=res_x, height=res_y, bg="#000000")
canvas.pack()
self.img = tkinter.PhotoImage(width=res_x, height=res_y)
canvas.create_image((res_x/2, res_y/2), image=self.img, state="normal")
self.mandel = MandelbrotColorPixels()
self.start_time = time.time()
self.root.after(1000, lambda: self.draw_line(0))
tkinter.mainloop()
示例5: launchButton2App
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def launchButton2App():
root = tk.Tk()
Button2App(root)
tk.mainloop()
示例6: DisplayAppLaunch
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def DisplayAppLaunch():
root = tk.Tk()
DisplayApp(root)
tk.mainloop()
示例7: launchEntryApp
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def launchEntryApp():
root = tk.Tk()
entryApp(root)
tk.mainloop()
示例8: launchApp
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def launchApp():
root = tk.Tk()
App(root)
tk.mainloop()
示例9: launchNoteBookApp
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def launchNoteBookApp():
root = tk.Tk()
NoteBookApp(root)
tk.mainloop()
示例10: launchTopLevelApp
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def launchTopLevelApp():
root = tk.Tk()
TopLevelApp(root)
tk.mainloop()
示例11: ControlledPorgressApp
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def ControlledPorgressApp():
root = tk.Tk()
ControlledProgress(root)
tk.mainloop()
示例12: launchSimpleCalenderApp
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def launchSimpleCalenderApp():
root = tk.Tk()
simpleCalender(root)
tk.mainloop()
示例13: launchPanedWindowApp
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def launchPanedWindowApp():
root = tk.Tk()
PanedWindowApp(root)
tk.mainloop()
示例14: _quit
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def _quit():
root.quit() # stops mainloop
root.destroy() # this is necessary on Windows to prevent
# Fatal Python Error: PyEval_RestoreThread: NULL tstate
示例15: run
# 需要导入模块: import tkinter [as 别名]
# 或者: from tkinter import mainloop [as 别名]
def run(self):
tk.mainloop()