On Fri, Jul 26, 2019 at 08:58:20PM +0200, Tom Hassel wrote:
Hello!
I've been getting into ltk, since I wanted to do some GUI programming again.
Very good! :)
[...]
The working code looks like this. How do I change the color of the button?
Long story short: ltk uses, by default, a set of widget (called "ttk") that does not support many configuration option that the old ones supported instead.
But this is only part of the story actually, I think this link on stack overflow (see the accepted reply) also could help you:
https://stackoverflow.com/questions/53504488/ltk-button-height-not-configura...
and the link below (also contained in the aforementioned page) probably is going to solve your issue:
https://mailman.common-lisp.net/pipermail/ltk-user/2016-June/000625.html
to try to clarify a bit more i suggest you take a look at:
https://www.tcl.tk/man/tcl8.6/TkCmd/button.htm
as you can see when the old widgets (i.e. non ttk) are used you get a command option: "background". The value can be set via the function "configure" as shown in:
http://www.peter-herth.de/ltk/ltkdoc/node13.html
by comparison see the new, (ttk) widget:
https://www.tcl.tk/man/tcl8.6/TkCmd/contents.htm
it does have the same option anymore, it use a theme system to drive the widgets visuals.
To change a background button of a ttk you should probably write a theme but for lack of skills, i can not help much about that, sorry! ^^;
Tangentially i suggest you to stick with the ttk widget set as it help to achieve a consistent visual appearance that improve usability, but this is matter of personal opinion i guess.
Hope this help!
Bye! C.