可以创建单像素宽的水平/垂直ttk.Separator吗?

发布于 2024-10-06 12:12:27 字数 194 浏览 1 评论 0原文

有没有办法创建单像素宽的水平和垂直 ttk.Separator() 的?

Python 2.7/Windows:当我放大 ttk 分隔符时,它们被构建为 2 条平行线 - 一条线灰色,一条线浅/白色。添加后一种颜色以创建微妙的 3D 效果?

我想创建具有系统默认灰色的单像素宽分隔符。一个好处是能够以编程方式发现用于分隔符灰色带的系统颜色。

Is there a way to create single pixel wide horizontal and vertical ttk.Separator()'s?

Python 2.7/Windows: When I magnify the ttk Separators they are built as 2 parallel lines - one line gray and one line a light/white color. The latter color added to create a subtle 3d effect?

I would like to create single pixel wide separators that have the system default gray color. A bonus would be the ability to programmatically discover the system color used for a separator's gray band.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花辞树 2024-10-13 12:12:27

如果您需要单像素线,请创建一个宽度为 1 的普通框架。它将具有默认的灰色背景。如果您想要根窗口的背景,您可以随时询问:

import Tkinter as tk
root = tk.Tk()
print "background is", root["background"]

If you need a single pixel line, create a normal frame with a width of 1. It will have the default gray background. If you want the background of the root window you can always just ask:

import Tkinter as tk
root = tk.Tk()
print "background is", root["background"]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文