slightlynybbled / tk_tools

Python tkinter tools, Python3.7+
MIT License
101 stars 25 forks source link

Integration with ttk and ttk_themes styling #25

Open maicol07 opened 6 years ago

maicol07 commented 6 years ago

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

slightlynybbled commented 6 years ago

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!

maicol07 commented 6 years ago

Thanks, keep me updated on your progresses!

thedesignatedgeek commented 6 months ago

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