[Gambas-user] Check Boxes (a bug?)
John Dovey
dovey.john at gmail.com
Fri Jun 11 04:34:16 CEST 2021
Thank you for laying it out for me. For some reason I got all tongue tied.
You describe my problem exactly.
I see Benoit indicates that this is expected behaviour. I’ve worked through
it twenty times and I can’t figure it out. Part of it is possibly my
confusion over what a click event it. I made the, probably incorrect,
assumption it would only trigger with an actual mouseclick, which is why I
first looked for a _changed event, like in the text boxes.
I’ll look at it again, relaxing “click” with “change” mentally and see if
it makes more sense to me.
All the best
John
On Thu, Jun 10, 2021 at 7:09 PM T Lee Davidson <t.lee.davidson at gmail.com>
wrote:
> 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
> >
> > JD
>
> 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.
>
>
> --
> Lee
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
--
Sent from Gmail Mobile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210610/de448d3b/attachment-0001.htm>
More information about the User
mailing list