Native colors for gui buttons

Propose new features and changes
cdull
Posts: 38
Joined: 11 Jan 2020, 07:34

Native colors for gui buttons

Post by cdull » 03 Mar 2021, 05:37

I wish to change the color of the font and background of a gui button within the button code (for example fc = font color and bc = background color):

Gui, Add, Button, fc000000 bc000000, Button name

I wish to see that in AHK v1 and v2.

I know there are some workarounds and i use them. But that would make all so much easier.

User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: Native colors for gui buttons

Post by Delta Pythagorean » 15 Mar 2021, 22:27

The best thing that I can think of to do (but not test, too lazy right now) would be to do the following:

Code: Select all

Gui, Color,, 0x000000    ; Set the color for the controls
Gui, Font, c0xFFFFFF
Gui, Add, Button, w75 h23 -Theme, Click me!
And yes, I know you use workarounds, but I would assume Lex tries to add features to AHK to help the language, not necessarily to solve a minor problem/add a "quality of life" tool here and there.

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat


cdull
Posts: 38
Joined: 11 Jan 2020, 07:34

Re: Native colors for gui buttons

Post by cdull » 19 Mar 2021, 14:27

Your workaround looks easy, but it is not working.

I think this is a feature that helps the language. It improves the possibilitys and makes it easier.

User avatar
SirSocks
Posts: 360
Joined: 26 Oct 2018, 08:14

Re: Native colors for gui buttons

Post by SirSocks » 23 Apr 2021, 23:10

I also think this would be a great option. I've seen many posts asking how to change the color of gui buttons. I think it would be great if there was a simple native solution.

lexikos
Posts: 9551
Joined: 30 Sep 2013, 04:07
Contact:

Re: Native colors for gui buttons

Post by lexikos » 24 Apr 2021, 22:55

If there was a simple native solution, you would already have it. There isn't one (Win32 buttons don't support setting colours), so I would have to implement a custom solution in C++. If someone else submits a satisfactory pull request which adds this functionality, it might happen.

Scripts to add functionality are generally not workarounds for missing functionality. If a script achieves your goal, it is a solution.

Colouring buttons does not help the language.

User avatar
DuckingQuack
Posts: 219
Joined: 20 Jan 2023, 18:20

Re: Native colors for gui buttons

Post by DuckingQuack » 30 Jan 2023, 20:33

Delta Pythagorean wrote:
15 Mar 2021, 22:27
The best thing that I can think of to do (but not test, too lazy right now) would be to do the following:

Code: Select all

Gui, Color,, 0x000000    ; Set the color for the controls
Gui, Font, c0xFFFFFF
Gui, Add, Button, w75 h23 -Theme, Click me!
And yes, I know you use workarounds, but I would assume Lex tries to add features to AHK to help the language, not necessarily to solve a minor problem/add a "quality of life" tool here and there.
I'm guessing there's no way to do something like this in V2?
Best of Luck,
The Duck

User avatar
boiler
Posts: 16766
Joined: 21 Dec 2014, 02:44

Re: Native colors for gui buttons

Post by boiler » 30 Jan 2023, 22:03

DuckingQuack wrote:
30 Jan 2023, 20:33
Delta Pythagorean wrote:
15 Mar 2021, 22:27
The best thing that I can think of to do (but not test, too lazy right now) would be to do the following:

Code: Select all

Gui, Color,, 0x000000    ; Set the color for the controls
Gui, Font, c0xFFFFFF
Gui, Add, Button, w75 h23 -Theme, Click me!
And yes, I know you use workarounds, but I would assume Lex tries to add features to AHK to help the language, not necessarily to solve a minor problem/add a "quality of life" tool here and there.
I'm guessing there's no way to do something like this in V2?
Yes, but there's really no reason to do so since that didn't do what it was meant to do in v1 either and you'll get the same result (nothing) in v2. As he said, he didn't test it, and he apparently didn't realize it changes neither the background color nor the text color of the button.

User avatar
DuckingQuack
Posts: 219
Joined: 20 Jan 2023, 18:20

Re: Native colors for gui buttons

Post by DuckingQuack » 31 Jan 2023, 05:43

Thank you, I misread that post.
Best of Luck,
The Duck

User avatar
boiler
Posts: 16766
Joined: 21 Dec 2014, 02:44

Re: Native colors for gui buttons

Post by boiler » 31 Jan 2023, 05:48

I think you probably read the post correctly. It just misrepresented what was possible.

Post Reply

Return to “Wish List”