tk_tools icon indicating copy to clipboard operation
tk_tools copied to clipboard

Integration with ttk and ttk_themes styling

Open maicol07 opened this issue 6 years ago • 3 comments

Hi, is it possible to style tk_tools widgets with tkinter.ttk or ttk_themes? Thanks

maicol07 avatar May 02 '18 20:05 maicol07

I have already began the process of styling the ttk-supported widgets - buttons, labels, etc - as ttk widgets, where possible. There are several instances in which there are no ttk-supported equivalents, so that will not be possible.

I have only recently began to use ttk widgets in my GUIs, so I am not super familiar with the nuances. I would welcome contributions in this area!

slightlynybbled avatar May 03 '18 10:05 slightlynybbled

Thanks, keep me updated on your progresses!

maicol07 avatar May 04 '18 17:05 maicol07

You can get the style information then update it yourself. For example,

sty=ttk.Style()
_bg=sty.lookup(".",background)
_fg=sty.lookup(".",foreground)
# _bg gets set to the theme background
# _fg gets set to the theme foreground
# then in you construct you can set the background
# for most of the widgets to bg=_bg

thedesignatedgeek avatar Jan 10 '24 00:01 thedesignatedgeek