我想删除/隐藏手电筒按钮,如果我以后指定手电筒显示“隐藏”。但我不知道怎么做。我到处找,就是找不到答案
healthKit_show = "show"
flashlight_show = "show"
def supplies_buttons():
supplies_showing = 1
flashlight_var = Button(Supplies, text = "Flashlight", command=flashlight)
healthKit_var = Button(Supplies, text = "healthKit", command=healthKit)
if flashlight_show == "show":
flashlight_var.grid(row=supplies_showing, column=0, sticky=W)
supplies_showing = supplies_showing + 1
if not flashlight_show == "show":
flashlight_var.pack_forget()
if healthKit_show == "show":
healthKit_var.grid(row=supplies_showing, column=0, sticky=W)
supplies_showing = supplies_showing + 1
if not flashlight_show == "show":
healthKit_var.pack_forget()
supplies_buttons()
flashlight_show = "hide"
supplies_buttons()
目前没有回答
相关问题 更多 >
编程相关推荐