📄 busy_cursor.py
字号:
import time
from Tkinter import *
class AfterIdleExample:
def __init__(self, master=None):
self.master = master
self.frame = Frame(master, relief=RAISED, borderwidth=2)
Label(self.frame, text='Press the button\nto start operation').pack()
self.frame.pack(padx=4, pady=4)
Button(master, text='Start', command=self.startOP).pack(side=TOP)
def startOP(self):
self.displayBusyCursor()
time.sleep(10.0) # simulate a long operation
def displayBusyCursor(self):
self.master.configure(cursor='watch')
self.master.update()
self.master.after_idle(self.removeBusyCursor)
def removeBusyCursor(self):
self.master.configure(cursor='arrow')
root = Tk()
root.option_readfile('optionDB2')
root.title('Busy Cursor')
example = AfterIdleExample(root)
root.mainloop()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -