Question

I have a GUI that allows you to create new tabs (using ttk). After the tab is created the user can open a file and I want the tab name to change to reflect the filename. Is there a way to change the text of the tab after it has already been placed? Such as a .config(text = '') method? Thanks for the help!

Was it helpful?

Solution

Yes, use the Notebook.tab method with the corresponding tab id and the text keyword. For instance, this changes the text of the first tab:

notebook.tab(0, text="New text")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top