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!

有帮助吗?

解决方案

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")
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top