python - 添加后如何以编程方式更改 tkinter 笔记本选项卡的文本

标签 python tkinter

将 Python 3.5 tkinter Notebook 选项卡添加到笔记本后,如何以编程方式更改其文本?

所以我添加了一个选项卡:

notebookWidget.add(tabWidget, text = 'myOldText')

效果很好。

现在,我想做一些类似的事情:

tabWidget.text = 'myNewText'

或者,(更tkinter'ish?):

tabWidget ['text'] = 'myNewText'

最佳答案

找到了:

notebookWidget.tab (tabWidget, text = 'myNewText')

关于python - 添加后如何以编程方式更改 tkinter 笔记本选项卡的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41077130/

相关文章:

python - 属性错误: object has no attribute 'listbox' ?

python - 在全屏模式下的 Raspberry pi 上的背景图像上创建文本

python - 更快地获得 2 个 numpy 数组的每个元素之间的差异

python - 对象和分配给它的 tkinter 对象有什么区别?

python - 使用 python 中 statsmodels 的 ExponentialSmoothing 通过三重指数平滑进行预测

python - 沿 2 个轴的 numpy `take`

python - 无法使用 Tkinter 打印出 "event.char"

python - 任何 ttk TreeView 行的不同 tkinter 绑定(bind)

python - 如何传递 docopt 参数,其中参数是 python 中带空格的字符串

python - 为什么函数可以改变外部的对象?