Discussion:
Tk not respecting colour style in Win 10 dark mode?
(too old to reply)
Harald Oehlmann
2021-11-03 07:59:02 UTC
Permalink
Hi all,
Not able to test/play around with this directly as I'm on Win 7, but a user has reported that my Tk app doesn't respect the colour scheme from Dark Mode on Windows 10. Is anyone aware of this?
We were able to manually configure most widget background colours to something suitably close to work around it for the most part, but the titlebar/menubar, for instance, remain the usual bright grey, which is problematic for the user in question who has light sensitivity.
All of the extra Tk colours which are defined on Windows, such as SystemButtonFace, also seem to be the same on their system as they are on mine, which suggests these are using some hardcoded values rather than actually getting them from the Windows settings as you'd expect.
Is there any way I'm not aware of to alter this, or would anyone agree that this is a bug in Tk?
Thanks for your help,
Mike
Mike,

yes, Tk does not respect the Windows dark mode.
I invite you to the awsome (and unfortunately abandoned) AWDark theme,
which is great as dark mode. It has a lot of options. I mainly use it
for Android...

Take care,
Harald
Mike Griffiths
2021-11-03 21:28:48 UTC
Permalink
Post by Harald Oehlmann
Hi all,
Not able to test/play around with this directly as I'm on Win 7, but a user has reported that my Tk app doesn't respect the colour scheme from Dark Mode on Windows 10. Is anyone aware of this?
We were able to manually configure most widget background colours to something suitably close to work around it for the most part, but the titlebar/menubar, for instance, remain the usual bright grey, which is problematic for the user in question who has light sensitivity.
All of the extra Tk colours which are defined on Windows, such as SystemButtonFace, also seem to be the same on their system as they are on mine, which suggests these are using some hardcoded values rather than actually getting them from the Windows settings as you'd expect.
Is there any way I'm not aware of to alter this, or would anyone agree that this is a bug in Tk?
Thanks for your help,
Mike
Mike,
yes, Tk does not respect the Windows dark mode.
I invite you to the awsome (and unfortunately abandoned) AWDark theme,
which is great as dark mode. It has a lot of options. I mainly use it
for Android...
Take care,
Harald
Hi Harald,

Thanks for the reply, I'll look into AWDark. I assume that the actual window elements such as the menubar and title bar will remain in their default bright colours even with this, though? Is anyone aware of any way to configure these? I did try and look through TWAPI in case I could find anything for configuring it, but had no luck. Guessing there might be something if I dig through Windows APIs and look at lower-level calls but I know this gets messy if you configure things about a window separately as Tk redraws things in its own way after...
nemethi
2021-11-04 11:50:23 UTC
Permalink
Post by Harald Oehlmann
I invite you to the awsome (and unfortunately abandoned) AWDark theme,
According to https://wiki.tcl-lang.org/page/awthemes the current version is 10.4.0 of 2021-6-18.
That is right, but, unfortunately, the package is abandoned, indeed.
Its author Brad Lanam posted on the same day on this newsgroup:

"... I will no longer be working with Tcl/Tk,
and I will not be putting time into supporting various Tcl/Tk
projects. I will no longer be paying attention to comp.lang.tcl."
--
Csaba Nemethi https://www.nemethi.de mailto:***@t-online.de
Alex Plotnikov
2021-11-05 05:58:52 UTC
Permalink
Post by nemethi
That is right, but, unfortunately, the package is abandoned, indeed.
Hi Csaba,

Ironically, Brad's one of interests is in GUI themes which isn't a coolest feature of his intended target to move, GTK.
All in all, "never say never/no longer" seems to be the case.
Mike Griffiths
2021-11-04 20:01:22 UTC
Permalink
Post by Harald Oehlmann
I invite you to the awsome (and unfortunately abandoned) AWDark theme,
According to https://wiki.tcl-lang.org/page/awthemes the current version is 10.4.0 of 2021-6-18.
Hi Mike,
The menu bar is indeed a capricious girl as for Tcl/Tk for Windows.
Can your user move to Windows 10? It provides a nice set of themes, incl. dark ones.
See, e.g., how "Mino Dark Green 6" theme of Windows 10 decorates alited editor. The editor is written in pure Tcl/Tk. In the screenshot, it uses its own "sun-valley-dark" theme (am sort of boasting:)
Loading Image...
Hi Alex,

The user is on Windows 10, but the app title bar and the menu bar are still a very old-school-style solid greyish in my Tcl/Tk app - if anything it looks more 'Classic Windows' there than it does on my Win 7 machine, not sure why. See Loading Image... for screenshots which show it using default colouring on the right, and with the highlighted code adapation on the left to recolour some widgets, which doesn't touch the window frame/menu.

I'm not sure if there's a reason it has that look for them on Win 10 (a friend of theirs, also on Win 10 with dark mode settings in Windows, is seeing the same thing) or if there's anything I/the user can do about it?
Alex Plotnikov
2021-11-05 05:25:04 UTC
Permalink
Post by Mike Griffiths
The user is on Windows 10, but the app title bar and the menu bar are still a very old-school-style solid greyish in my Tcl/Tk app - if anything it looks more 'Classic Windows' there than it does on my Win 7 machine, not sure why. See https://i.imgur.com/PuWphYN.png for screenshots which show it using default colouring on the right, and with the highlighted code adapation on the left to recolour some widgets, which doesn't touch the window frame/menu.
I'm not sure if there's a reason it has that look for them on Win 10 (a friend of theirs, also on Win 10 with dark mode settings in Windows, is seeing the same thing) or if there's anything I/the user can do about it?
Mike,

Indeed looks bad. With icons in any case, Windows or not.
Still, you didn't supply details (me too, though:), i.e.
- what version of Tcl/Tk for Windows (mine is 8.6.8)
- do you use tclsh or tclkit? or perhaps a stand-alone exe?
- if it's tclkit, what's its origin?
- do you use a specific package rendering GUI? or it's all core Tcl/Tk?
- what Tk theme are you using? sincerely, I cannot recognize your Tk theme by your shots (because of their poor resolution)
- did you try the recommended awdark theme?
Ideally, you might drop a link to the sources to try it by others. Or at least, if it's not free, a part of it being enough to try.
Alex Plotnikov
2021-11-12 09:43:17 UTC
Permalink
Post by Alex Plotnikov
Post by Mike Griffiths
The user is on Windows 10, but the app title bar and the menu bar are still a very old-school-style solid greyish in my Tcl/Tk app - if anything it looks more 'Classic Windows' there than it does on my Win 7 machine, not sure why. See https://i.imgur.com/PuWphYN.png for screenshots which show it using default colouring on the right, and with the highlighted code adapation on the left to recolour some widgets, which doesn't touch the window frame/menu.
I'm not sure if there's a reason it has that look for them on Win 10 (a friend of theirs, also on Win 10 with dark mode settings in Windows, is seeing the same thing) or if there's anything I/the user can do about it?
Mike,
Indeed looks bad. With icons in any case, Windows or not.
Still, you didn't supply details (me too, though:), i.e.
- what version of Tcl/Tk for Windows (mine is 8.6.8)
- do you use tclsh or tclkit? or perhaps a stand-alone exe?
- if it's tclkit, what's its origin?
- do you use a specific package rendering GUI? or it's all core Tcl/Tk?
- what Tk theme are you using? sincerely, I cannot recognize your Tk theme by your shots (because of their poor resolution)
- did you try the recommended awdark theme?
Ideally, you might drop a link to the sources to try it by others. Or at least, if it's not free, a part of it being enough to try.
Mike,
Did you try? Or it's somewhat of nothing for you?
Alexandru
2021-11-13 03:47:26 UTC
Permalink
Hi all,
Not able to test/play around with this directly as I'm on Win 7, but a user has reported that my Tk app doesn't respect the colour scheme from Dark Mode on Windows 10. Is anyone aware of this?
We were able to manually configure most widget background colours to something suitably close to work around it for the most part, but the titlebar/menubar, for instance, remain the usual bright grey, which is problematic for the user in question who has light sensitivity.
All of the extra Tk colours which are defined on Windows, such as SystemButtonFace, also seem to be the same on their system as they are on mine, which suggests these are using some hardcoded values rather than actually getting them from the Windows settings as you'd expect.
Is there any way I'm not aware of to alter this, or would anyone agree that this is a bug in Tk?
Thanks for your help,
Mike
I asked myself the same question after switching my Windows 10 to dark mode and realized that my Tcl/Tk app doesn't care about that change. Until now I thought the philosophy of Tcl/Tk is to adapt the looks and feel automatically to the current OS. Aside from the fact that AWDark is abandoned, I think the adaption to the theme belongs into the core. And it would be very cool to have that, since other apps such as Firefox also ignore the Windows theme.

BTW: Is there a way in Tcl/Tk to get the current theme?

Regards
Alexandru
Francois Vogel
2021-11-13 08:15:01 UTC
Permalink
Post by Alexandru
BTW: Is there a way in Tcl/Tk to get the current theme?
Yes.

ttk::style theme use

will return it.

Regards,
Francois

Loading...