Tkinter: Query system preferences colors

Phlip phlip_cpp at
Tue Aug 27 02:30:02 CEST 2002

Thanks to you and the other poster(s), however...

"Jeff Epler" wrote:

>     >>> i = c.create_rectangle((10, 10, 40, 40),
fill=c.option_get("selectBackground", "Foreground"))

Observe you used Canvas.option_get(). This did not work (to query the default
setting); the prop comes back blank.

If I create a Listbox (and then never pack it), it has the correct prop.

If I >have< a Listbox, I might as well call cget('selectbackground') on it.
This means I'm using a Listbox as a trick to get the system properties. I can

Finally, .Xdefaults contains only a smattering of settings for cheesy legacy
apps such as emacs and vim; it is not a preferences registry.

So, the gap in documentation remains, but the workaround obeys Python's usual
performance profile.


More information about the Python-list mailing list