|
所述Checkbuttons的任何数目可以由用户来选择。
任何选定Checkbuttons可以由用户选中。
当选择任何两Checkbuttons,标签显示“捕捉”。
当选择Checkbuttons的超过3个,显示没有东西
from Tkinter import *
# Create a window
the_window = Tk()
# Give the window a title
the_window.title('SNAP')
the_window.geometry("300x100")
#--------------------------------------
from ScrolledText import ScrolledText
# PUT YOUR CODE HERE-------------------------------------------------#
display = ScrolledText(the_window,font=('Arial',24),width =10,height =2,
borderwidth=2,relief='groove')
display.place(x=80,y=7)
def display_snap():
display.insert(END,'Snap')
checkbox = Checkbutton(the_window,command = display_snap)
checkbox.place(x=10,y=80)
checkbox2 = Checkbutton(the_window)
checkbox2.place(x=60 , y=80)
checkbox3 = Checkbutton(the_window)
checkbox3.place(x=110 , y=80)
checkbox4 = Checkbutton(the_window)
checkbox4.place(x=160 , y=80)
checkbox5 = Checkbutton(the_window)
checkbox5.place(x=210 , y=80)
|
|