Tkinter, скрытие виджетов
утро, вечер, у меня возник вопрос. Как сделать что бы при нажатие на кнопку контакт, скрывались все лишние виджеты.
from tkinter import *
import time
import webbrowser
root = Tk()
root.resizable(height= False, width= False)
root.geometry("800x500")
root.wm_attributes("-alpha", 0.9)
root ['bg'] = 'black'
root.iconbitmap('123.ico')
root.title('Test')
def com():
destroy_object = [btn,click_label]
for object_name in destroy_object:
object_name.destroy()
Label(root, text = 'main menu',
font = 'Consolas 30',
fg = 'white',
bg = 'black').pack()
onibor = Label(root,text = 'select item'
, fg = 'white',
bg = 'black',
font = 'Consolas').place(x = 350, y = 75)
btn1 = Button(text ='1.telegram bot',
relief= 'solid',
fg='white',
bg='black',
font='Consolas',
command=telegram).place(x=50,y = 150)
btn2 = Button(text = '2.contact',
relief= 'solid',
fg = 'white',
bg = 'black',
font = 'Consolas',
command = conntact ).place(x = 50, y = 190)
btn3 = Button(text = '3.ext',
relief= 'solid',
fg ='white',
bg = 'black',
font = 'Consolas',
command = exict).place(x = 50 , y = 230)
def telegram():
destroy_obj = []
for object_name in destroy_obj:
object_name.destroy()
webbrowser.open('https://web.telegram.org', new=2)
def conntact():
destroy_object = [click_label,text_menu,]
for object_name in destroy_object:
object_name.destroy()
discord = Label(root, text = 'echodamage#1337', fg = 'white',
font = 'Consolas',
bg = 'black',
relief = 'solid'
).place(x = 330, y = 150)
def exict():
exit()
btn = Button(text = 'click t0 start', relief= 'solid',
bg = 'black',
fg = 'white',
font = 'Consolas''5',
command=com)
click_label = Label(root, text = 'Hell0,thx for d0wl0and',fg='white', bg= 'black' ,font = 'Consolas')
pass
click_label.pack()
btn.place(x=350, y=150)
root.mainloop()
Заранее спасибо!