你能在tkinter应用程序中制作"categories"吗



这有点难解释,因为我不知道它到底叫什么,但我目前正在制作一个应用程序(我是一个初学者(,我想知道,点击一个按钮,它是否可以带你进入一个不同的"部分";应用程序的。例如,该程序要求你在两个类别之间进行选择,如电影或节目,点击其中一个,它会将你带到应用程序的另一个部分,例如,它可能会问你想看什么类型的电影等,并最终显示你选择的类别中的几部电影这个例子与我的应用程序无关,但它是为了让我试图做的事情更清晰

from tkinter import *
root = Tk()
def fun1():
root.destroy()
root2=Tk()
#add buttons, categories here for movies
def fun2():
root.destroy()
root3=Tk()
#add buttons, categories here for shows

bt1 = Button(root, text = 'movies', command=fun1)
bt2 = Button(root, text = 'shows', command=fun2)
bt1.pack()
bt2.pack()

最新更新