質問

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