Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_peekaboo_buttons.py
- from Tkinter import *
- root = Tk()
- def demo(*args):
- def show_label():
- label.grid()
- def hide_label():
- label.grid_remove()
- disp = Entry(root)
- disp.grid(column=0, row=0, columnspan=4)
- label = Label(text="Peek-A-Boo!")
- label.grid(column=0, row=1, columnspan=4, sticky=N+S+E+W)
- button1 = Button(text="Click To Hide Label",
- command=hide_label)
- button1.grid(column=0, row=2, columnspan=4, sticky=N+S+E+W)
- button2 = Button(text="Click To Show Label",
- command=show_label)
- button2.grid(column=0, row=3, columnspan=4, sticky=N+S+E+W)
- demo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement