简体   繁体   中英

What is ttk's tkinter default color style for MAC OSX

I'm looking for either the exact colour name for ttk frames or for a way to dynamically retrieve that information. My problem is that the tkinter

root = tk()

and

button = ttk.Button()

give me two different widget background colours. This was not an issue when I developed the GUI on ubuntu linux , but the colours are different when I tried to run the code on MAC OSX 10.8.1

I haven't been able to find any calls/attributes that would give me that information, and there are so many different colours it could be (white, light white, seashell white, etc...)

Anyone know these default colour names?

I'm using python 2.7.2, tkinter, ttk, MAC 10.8.1

I don't know how to get that information. The problem is, there may not be a single color for the background (it might be a slight gradient or pattern). If the problem is that the background of your app looks wrong there's a simple trick: place a ttk.Frame() widget over the entire root window, and then just code as usual. As long as the stacking level of the frame is low, all your other widgets will appear above it.

I use place for this, giving an x and y of zero and a relwidth and relheight of 1.0. Using place guarantees it would affect the use of pack or grid for all your other widgets.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM