Adding tkinter modules to notebook tabs

Christian Gollwitzer auriocus at gmx.de
Sat Apr 4 15:06:30 EDT 2020


Am 04.04.20 um 16:59 schrieb Rich Shepard:
> My Python3-3.8.2 application has 8 modules with subject-specific data
> entry/editing widgets and I want to display each module on a ttk.Notebook.
> Each notebook resource I've found in my reference books and on the web
> describe how to create a notebook and tabs and add labels to the tabs; a 
> few
> describe how to place individual widgets on a tab. But I've not found 
> how to
> place a widget-filled module on a notebook tab.

I'm not sure I fully understand it, because a "module" is not defined in 
the language of tkinter. Is it correct, you want to know how to place 
more than one widget - a arrangement of widgets - onto a notebook tab?

This is achieved by a ttk.Frame() widget, which holds all the other 
stuff, and then you place the frame onto the notebook:

n=ttk.Notebook()
f1=ttk.Frame()
# put all your stuff into f1
n.add(f1, text="Module1")
# repeat for your other "modules"


	Christian


More information about the Python-list mailing list