[Gambas-user] Check Boxes (a bug?)
T Lee Davidson
t.lee.davidson at gmail.com
Fri Jun 11 02:08:18 CEST 2021
On 6/10/21 5:09 PM, John Dovey wrote:
> I have an odd change of value which I can't track down.
> I load some values of true and false from an ini file into variables declared as boolean, then set the checkbox.value = variable
> On the .click event of the checkbox, I make some changes but when it emerges from that, the values are back to defaults. You can
> see in the load event of the form I have some debug statements to show the change.
> You can see the check boxes on the third tab
Bruce Steers is right about hSettings needing to be global. I made changes to effect that including not re-creating it multiple
times. And, it still does not work as it should. The settings do get saved correctly, but upon a relaunch, they are reverted.
Stepping through the program, I see that at line 126 ("ChkAflag_CM.Value = myAflag_CM"),
*setting the value of the CheckBox is treated as a click* and the ChkAflag_CM_Click event handler is triggered.
** Benoît, is this expected behavior, or a bug? **
The Click event handler calls myMakeAflags() which tests the value of each CheckBox and sets the appropriate myAflag_[XX]
accordingly. Since the only checkbox with a true value is ChkAflag_CM, the settings are reverted to the same as the default.
More information about the User