Tkinter颜色在OS X上更轻 [英] Tkinter colours lighter on OS X

查看:161
本文介绍了Tkinter颜色在OS X上更轻的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以这个简单的例子:

  import Tkinter 

root = Tkinter.Tk b $ b root.configure(bg =#000000)
root.configure(borderwidth = 20)
root.geometry('%dx%d +%d +%d'%(200,200, 200,200))

frame = Tkinter.Frame(root,bg =#444444,borderwidth = 20)
frame.pack(fill = Tkinter.BOTH)

frame2 = Tkinter.Frame(frame,bg =#999999,height = 120)
frame2.pack(fill = Tkinter.BOTH)
root.mainloop()

如果在OS X上运行此操作,然后打开DigitalColor Meter并将鼠标悬停在每个框上,浅灰色不符合代码中的内容。
如果我将鼠标悬停在内部方块上,我会得到#A9A9A9 (而不是#999999 而中间的正方形给出#565656 (而不是#444444 )。



我使用Python 2.7.8,Tc / Tk 8.5运行OS X 10.9(Tkinter指定 __ version__ ='$ Revision:81008 $'

有没有人遇到过这个问题,如果有什么是正确的解决方法?

解决方案

FYI - 对于这个问题的答案,所以我在tkinter-python邮件列表上的帖子:
https://mail.python.org/pipermail/tkinter-discuss/2015-January/003690.html


Take this simple example:

import Tkinter

root = Tkinter.Tk()
root.configure(bg="#000000")
root.configure(borderwidth=20)
root.geometry('%dx%d+%d+%d' % (200, 200, 200, 200))

frame = Tkinter.Frame(root, bg="#444444", borderwidth=20)
frame.pack(fill=Tkinter.BOTH)

frame2 = Tkinter.Frame(frame, bg="#999999", height=120)
frame2.pack(fill=Tkinter.BOTH)
root.mainloop()

If you run this on OS X and then open up DigitalColor Meter and hover over each box, you will see that the two lighter grey colours don't match what is in the code. If I hover over the the inner square, I get #A9A9A9 (instead of #999999), and the middle square gives #565656 (instead of #444444).

I'm running OS X 10.9 with Python 2.7.8, Tc/Tk 8.5 (Tkinter specifies __version__ = '$Revision: 81008 $')

Has anybody else experienced this problem, and if so what is the right fix?

解决方案

FYI - for an answer to this question, so my post on the tkinter-python mailing list: https://mail.python.org/pipermail/tkinter-discuss/2015-January/003690.html

这篇关于Tkinter颜色在OS X上更轻的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆