Pergunta

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!

Foi útil?

Solução

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")
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top