tkinter how to unplace a widget

Solutions on MaxInterview for tkinter how to unplace a widget by the best coders in the world

showing results for - "tkinter how to unplace a widget"
Cloé
04 Aug 2016
1 pythonCopytry:
2    import Tkinter as tk
3except:
4    import tkinter as tk
5    
6
7class Test():
8   def __init__(self):
9       self.root = tk.Tk()
10       self.label=tk.Label(self.root,
11                           text = "Label")
12       self.buttonForget = tk.Button(self.root,
13                          text = 'Click to hide Label',
14                          command=lambda: self.label.grid_forget())
15       self.buttonRecover = tk.Button(self.root,
16                          text = 'Click to show Label',
17                          command=lambda: self.label.grid())       
18       
19       self.buttonForget.grid(column=0, row=0, padx=10, pady=10)
20       self.buttonRecover.grid(column=0, row=1, padx=10,  pady=10)
21       self.label.grid(column=0, row=2, padx=10, pady=10)
22       self.root.mainloop()
23
24   def quit(self):
25       self.root.destroy()
26        
27app = Test()
28
similar questions
queries leading to this page
tkinter how to unplace a widget