Finding the currently selected tab of Ttk Notebook

前端 未结 5 1511
南旧
南旧 2021-02-07 19:58

I have a Ttk Notebook widget containing 8 Frames - so, 8 tabs. Each frame contains a Text widget. I have a button outside the Notebook widget, and I want to insert text into the

5条回答
  •  我寻月下人不归
    2021-02-07 20:30

    You can get currently selected tab using the "current" keyword:

    noteBook.index("current")
    

    Check this website: https://docs.python.org/2/library/ttk.html#tab-identifiers 24.2.5.3. Tab Identifiers

提交回复
热议问题