AHK v2 a124 - Radio value can't be set Topic is solved

Report problems with documented functionality
User avatar
TheArkive
Posts: 435
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

AHK v2 a124 - Radio value can't be set

21 Feb 2021, 07:30

Simply trying to set a Radio value with ctl.value := 1 doesn't appear to work anymore.

And oddly, when encapsulating the value in an array or object prop/value pair, no error is thrown, but the value is still not assigned.

Code: Select all

test := Gui.New("+0x200000")
test.onEvent("close","gui_close")

ctl := test.Add("Radio","vMyRadio","test radio")
ctl.value := {value:1}  ; no error - doesn't set value
ctl.value := {1:1}   ; no error - doesn't set value
ctl.value := [1]        ; no error - doesn't set value
ctl.value := 1          ; error    - doesn't set value

ctl := test.Add("Text","vMyText","text start test")
ctl.text := "test done" ; value set as expected

test.Show("w300 h300")

gui_close(*) {
    ExitApp
}

Of course, for a Radio control, I wouldn't expect that an array or obj prop/value pair would do anything, just odd that it didn't throw an error, but ctl.value := 1 did.

Looked for a change in the docs... didn't see anything different for Radio.

Error Message:

Code: Select all

---------------------------
__test_v2.ahk
---------------------------
Error:  Invalid value.

Specifically: 1

	Line#
	017: test := Gui.New("+0x200000")
	018: test.onEvent("close","gui_close")
	020: ctl := test.Add("Radio","vMyRadio","test radio")
--->	024: ctl.value := 1
	027: ctl := test.Add("Text","vMyText","text start test")
	028: ctl.value := "test done"
	042: test.Show("w300 h300")
	046: {
	047: ExitApp()
	048: }
	049: Exit

Try to continue anyway?
---------------------------
Yes   No   
---------------------------
Last edited by TheArkive on 21 Feb 2021, 11:05, edited 1 time in total.
User avatar
kczx3
Posts: 1255
Joined: 06 Oct 2015, 21:39

Re: AHK v2 a124 - Radio value can't be set

21 Feb 2021, 09:26

What’s the error say?
User avatar
TheArkive
Posts: 435
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: AHK v2 a124 - Radio value can't be set

21 Feb 2021, 11:05

@kczx3
My bad, updated the OP with the error message.
swagfag
Posts: 4143
Joined: 11 Jan 2017, 17:59

Re: AHK v2 a124 - Radio value can't be set

21 Feb 2021, 20:37

its due to a refactoring that left the radio-ctrl case to now incorrectly fallthrough to the picture-ctrl case, instead of the checkbox-ctrl case as it used to be
compare old / new

u could swap the lines around (and add an additional one in the case further below) and recompile, if u dont want to wait for the fixed version to drop
User avatar
TheArkive
Posts: 435
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: AHK v2 a124 - Radio value can't be set

22 Feb 2021, 05:07

Thanks @swagfag

I'm good to wait :) this one bit is actually not debilitating for my scripts at this point.
swagfag
Posts: 4143
Joined: 11 Jan 2017, 17:59

Re: AHK v2 a124 - Radio value can't be set  Topic is solved

22 Feb 2021, 19:45

looks like its been fixed already

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 2 guests