[Gambas-user] RadioButton events (1.9.46a) & simplified
Richard
richard.j.walker at ...247...
Thu Feb 1 00:00:42 CET 2007
On Wednesday 31 Jan 2007 22:41, Stefano Palmeri wrote:
> Alle 20:25, mercoledì 31 gennaio 2007, Richard ha scritto:
> > Thank you both very much for setting me straight. Stefano, I'd love to
> > know how you knew to change a RadioButton value by setting the value of
> > another RadioButton. I stared at it for hours without guessing that
> > approach.
>
> This is from the Gambas help:
> ---------------------------------------------------------
> RadioButton
>
> This implements a radio button control.
> Radio buttons having the same parent are mutually exclusive. Only one can
> be selected at the same time.
> ----------------------------------------------------------
>
>
> They are different from CheckBoxes, which are not mutually exclusive.
>
> Ciao,
>
> Stefano
Thanks Stefano, I had understood the operation, I just hadn't realised that I
wouldn't be allowed to toggle the TRUE button in a pair. By choosing just one
to set to either TRUE or FALSE, I had expected that the "other" button would
become the complement of the one I was assigning a value.
My program is switching between mono and stereo for both the input and the
output. I am storing the required mode in two boolean variables; one for
input and one for output. I was updating the form controls by writing the
value of each variable into one of the input and one of the output
RadioButton controls. This depended on the mono/stereo pairs of RadioButtons
being updated in a way not supported by Gambas.
Following your advice I have added two more event handlers (for the "mono"
buttons) and a few extra lines to figure out which RadioButton must be set to
TRUE. It is a lot less "elegant" but has the distinct advantage of working
properly :~)
Richard
More information about the User
mailing list