#TCL Radio Buttons
I am just starting to use TCL and am very confused it seems. I have a window
on which I placed several RadioGroupPanes, each with 4 buttons. The original
code is generated by AppMaker 1.5.4. I am trying to get/set the initial values
of the radio buttons, but it ain't working.
One of the radio groups is created by AM as:
Group5 = new CRadioGroupPane;
Group5->IViewRes ('Pane', 133, enclosure, supervisor);
R5Radio = new CAMRadioControl;
R5Radio->IViewRes ('CtlP', 148, Group5, Group5);
JG5Radio = new CAMRadioControl;
JG5Radio->IViewRes ('CtlP', 149, Group5, Group5);
N5Radio = new CAMRadioControl;
N5Radio->IViewRes ('CtlP', 147, Group5, Group5);
L5Radio = new CAMRadioControl;
L5Radio->IViewRes ('CtlP', 177, Group5, Group5);
I then wrote the start of an initialization function with some testing in it to
see if I was approaching it right (I'm not) as:
/*———-*/
void CRinger::IRingerRadio (void)
{
long id;
id = Group5->GetStationID ();
Group5->SetStationID (147);
id = Group5->GetStationID ();
} /* IRingerRadio */
When I do the initial query, I get back a value of 0, which indicates that
nothing is selected. However, visually I can see that one radio is on, which
should mean that it is already selected?
I tried various inputs to the SetStationID, but it looked like I had to use the
same resource number that was used in the IViewRes call. It doesn't seem
reasonable that I would be expected to hard code those numbers in my stuff, but
I went ahead for this quick test. No dice — after the call, no radio is
highlighted — it even turns off the one that was on before (which at least
tells me I have hit the proper radio group).
The next call to GetStationID again returns 0, indicating that nothing is set.
At least that now agrees with the visual display…
What am I supposed to pass to these two calls to properly query/set the radio
buttons within a specified radio group?
– Burt