【发布时间】:2018-02-12 14:00:27
【问题描述】:
我正在制作一个 GUI 应用程序,其中有 4 个条目部分,如果我在一个条目框中输入文本,则所有条目框都在获取数据。我该如何编码,只有在单击条目框时才应该分别输入...
代码:
from Tkinter import *
def time():
t1h=int(Ihr.get())
t1m=int(Imin.get())
t2h=int(Ohr.get())
t2m=int(Omin.get())
app = Tk()
app.title("VM")
app.geometry("150x210")
app.resizable(0,0)
note = Label(app, text="Clock IN Time :")
note.place(x=10, y=10)
Ihr = Entry(app,text="...")
Ihr.place(x=10, y=30,width="30")
Ihr.focus()
note = Label(app, text="::")
note.place(x=43, y=30)
Imin = Entry(app,text="...")
Imin.place(x=60, y=30,width="30")
note = Label(app, text="(hr)")
note.place(x=12, y=50)
note = Label(app, text="(min)")
note.place(x=58, y=50)
【问题讨论】: