문제

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