Native colors for gui buttons
Native colors for gui buttons
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.
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.
- Delta Pythagorean
- Posts: 627
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: Native colors for gui buttons
The best thing that I can think of to do (but not test, too lazy right now) would be to do the following:
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.
Code: Select all
Gui, Color,, 0x000000 ; Set the color for the controls
Gui, Font, c0xFFFFFF
Gui, Add, Button, w75 h23 -Theme, Click me!
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
Re: Native colors for gui buttons
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.
I think this is a feature that helps the language. It improves the possibilitys and makes it easier.
Re: Native colors for gui buttons
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.
Re: Native colors for gui buttons
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.
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.
- DuckingQuack
- Posts: 219
- Joined: 20 Jan 2023, 18:20
Re: Native colors for gui buttons
I'm guessing there's no way to do something like this in V2?Delta Pythagorean wrote: ↑15 Mar 2021, 22:27The best thing that I can think of to do (but not test, too lazy right now) would be to do the following: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.Code: Select all
Gui, Color,, 0x000000 ; Set the color for the controls Gui, Font, c0xFFFFFF Gui, Add, Button, w75 h23 -Theme, Click me!
Best of Luck,
The Duck
The Duck
Re: Native colors for gui buttons
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.DuckingQuack wrote: ↑30 Jan 2023, 20:33I'm guessing there's no way to do something like this in V2?Delta Pythagorean wrote: ↑15 Mar 2021, 22:27The best thing that I can think of to do (but not test, too lazy right now) would be to do the following: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.Code: Select all
Gui, Color,, 0x000000 ; Set the color for the controls Gui, Font, c0xFFFFFF Gui, Add, Button, w75 h23 -Theme, Click me!
- DuckingQuack
- Posts: 219
- Joined: 20 Jan 2023, 18:20
Re: Native colors for gui buttons
I think you probably read the post correctly. It just misrepresented what was possible.