from tkinter import *
def name_1_cs():
ydm_1_2.place_forget()
ydmwz_1_2.place_forget()
ydmwz_1_2_B1.place_forget()
xz_1_1.place_forget()
ydmwz_1_2_B2.place_forget()
xz_1_2.place_forget()
mulu_1.place_forget()
mulu_2.place_forget()
mulu_3.place_forget()
mulu_4.place_forget()
mulu_2_2.place_forget()
mulu_3_3.place_forget()
mulu_4_4.place_forget()
xx_2_1.place_forget()
xx_2_2.place_forget()
xx_2_3.place_forget()
xx_2_4.place_forget()
mulu_1_1.place(x=15, y=90)
xx_1_1.place(x=15, y=130)
xx_1_2.place(x=15, y=170)
xx_1_3.place(x=15, y=210)
xx_1_4.place(x=15, y=250)
xx_2_1.config(fg='#C0C0C0')
xx_2_2.config(fg="#C0C0C0")
xx_2_3.config(fg="#C0C0C0")
xx_2_4.config(fg="#C0C0C0")
print("按钮1")
# 第一个组件的子元件
def xx_1_name_1_cs():
xx_1_1.config(fg='#000000')
xx_1_2.config(fg="#C0C0C0")
xx_1_3.config(fg="#C0C0C0")
xx_1_4.config(fg="#C0C0C0")
print(1)
def xx_1_name_2_cs():
xx_1_2.config(fg='#000000')
xx_1_1.config(fg="#C0C0C0")
xx_1_3.config(fg="#C0C0C0")
xx_1_4.config(fg="#C0C0C0")
print(2)
def xx_1_name_3_cs():
xx_1_3.config(fg='#000000')
xx_1_2.config(fg="#C0C0C0")
xx_1_1.config(fg="#C0C0C0")
xx_1_4.config(fg="#C0C0C0")
print(3)
def xx_1_name_4_cs():
xx_1_4.config(fg='#000000')
xx_1_2.config(fg="#C0C0C0")
xx_1_3.config(fg="#C0C0C0")
xx_1_1.config(fg="#C0C0C0")
print(4)
#------------------------------------
def name_2_cs():
ydm_1_2.place_forget()
ydmwz_1_2.place_forget()
ydmwz_1_2_B1.place_forget()
xz_1_1.place_forget()
ydmwz_1_2_B2.place_forget()
xz_1_2.place_forget()
mulu_2.place_forget()
mulu_3.place_forget()
mulu_4.place_forget()
mulu_1_1.place_forget()
mulu_3_3.place_forget()
mulu_4_4.place_forget()
mulu_2_2.place(x=15, y=130)
xx_2_1.place(x=15, y=170)
xx_2_2.place(x&
标签:tkinter,forget,C0C0C0,python,xx,place,测试,fg,config
From: https://blog.csdn.net/ChuHAoya/article/details/142665590