windows 如何自定义 tkinter/ttk 小部件和框架的边框颜色?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4121302/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:34:27  来源:igfitidea点击:

How to customise the border color of tkinter/ttk widgets and frames?

pythonwindowscolorstkinterborder

提问by Malcolm

Is there any way to customize the border color of a Tkinter/ttkwidgets or frames?

有没有办法自定义Tkinter/ttk小部件或框架的边框颜色?

采纳答案by Bryan Oakley

Yes, you can create your own styleand apply it to the widget or configure the attributes of an existing style.

是的,您可以创建自己的样式并将其应用于小部件或配置现有样式的属性。

Some documentation and examples are in the official docs, specifically the section about ttk.Style.

一些文档和示例在官方文档中,特别是关于ttk.Style的部分。

Additional information on using styles (for several languages) can be found at tkdocs.com.

可以在tkdocs.com上找到有关使用样式(适用于多种语言)的其他信息。