这是我的代码:
import tkinter as tk
from tktimepicker import AnalogPicker, AnalogThemes,constants
root = tk.Tk()
time_picker = AnalogPicker(root,type=constants.HOURS24)
time_picker.pack(expand=True, fill="both")
theme = AnalogThemes(time_picker)
theme.setDracula()
root.mainloop()
回答1
这是您需要的https://github.com/PaulleDemon/tkTimePicker/blob/master/Documentation.md。
小时:
方法: getHours
- 这不接受任何参数并返回它所指向的当前小时。
事件:<<HoursChanged>>
- 更改小时数时生成此事件。
分钟:
方法:getMinutes
- 不带参数并返回当前分钟。
事件:<<MinChanged>>
- 分钟更改时生成。
https://github.com/PaulleDemon/tkTimePicker/blob/master/examples/SpinTimePickerExample.py