0

How can I change my Tkinter window's content? Like a webpage where you click buttons to go to different places?

(Preferably without classes)

  • Does this answer your question? [Using buttons in Tkinter to navigate to different pages of the application?](https://stackoverflow.com/questions/14817210/using-buttons-in-tkinter-to-navigate-to-different-pages-of-the-application) – Thingamabobs Nov 29 '20 at 12:53
  • I am looking for a simpler way. I haven't started learning classes yet.. – Samrath Chadha Nov 30 '20 at 08:29

1 Answers1

1

Your question is quite vague, but I believe the ttk.Notebook widget may be of use. Here is an example of how to have different tabs of content:

from tkinter import *
from tkinter.ttk import *

root = Tk()
tabmanager = Notebook(root)
tabmanager.pack(expand=1,fill="both")

tab1 = Frame(tabmanager)
tab2 = Frame(tabmanager)

tabmanager.add(tab1,text="Home")
tabmanager.add(tab2,text="About")

root.mainloop()

You can then add whatever widgets you like to the frames. Hopefully this answers your question; let me know if you need more help :)

TheFluffDragon9
  • 514
  • 5
  • 11