包含:
· Button
· Listbox
· Text
def do_xxx():
print(1)
def do_test():
print('testing...')
root = tk.Tk()
root.geometry("800x600+300+50")
# Button 'b'
b = tk.Button(root,text='Test',relief='groove',command=do_test)
b.grid(column=1,row=1)
# listbox 'lst'
lst = tk.Listbox(root, width=20)
##lst.pack(side="left", fill=tk.BOTH, expand=0)
lst.grid(column=1,row=2,rowspan=5)
# Text 't'
t = tk.Text(root,width=20,height=7,foreground='blue',relief='groove')
##t.pack(side="left", fill=tk.BOTH, expand=0)
t.grid(column=1,row=8,rowspan=5)
t.insert('1.0','Text')
# run and end
do_xxx()
root.mainloop()