I'm just trying to turn off one radio button and turn the other one on when a hit on it occurs. I am NOT using a pre-defined cluster from Interface Builder, just 2 separate radio buttons.
Is there any reason why I can see my dialog box (indicating I made it into the code block) yet the controls do not reflect the fact I hit them?
I must be missing something so elementary it almost defies explanation
Is there any reason why I can see my dialog box (indicating I made it into the code block) yet the controls do not reflect the fact I hit them?
I must be missing something so elementary it almost defies explanation
Code:
#define kFirstRadioSig 'frad'
#define KSecondRadioSig 'srad'
#define kFirstRadio_ID 63
#define KSecondRadio_ID 64
DialogRef alert;
DialogItemIndex userItemHit;
ControlID radio_button_control_ID;
ControlRef radio_button_control_ref;
GetEventParameter(your_event, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &the_command);
switch(the_command.commandID)
{
case KSecondRadioSig:
/**********************************/
/* 1st radio button turns off ... */
/**********************************/
radio_button_control_ID.signature = kFirstRadioSig;
radio_button_control_ID.id = kFirstRadio_ID;
GetControlByID(g_drawer_window_with_buttons, &radio_button_control_ID, &radio_button_control_ref);
SetControlValue(radio_button_control_ref, 0);
/**********************************/
/* 2nd radio button turns on ... */
/**********************************/
radio_button_control_ID.signature = KSecondRadioSig;
radio_button_control_ID.id = KSecondRadio_ID;
GetControlByID(g_drawer_window_with_buttons, &radio_button_control_ID, &radio_button_control_ref);
SetControlValue(radio_button_control_ref, 1);
CreateStandardAlert(kAlertPlainAlert, CFSTR("--- YOU MADE IT HERE ---"), CFSTR("Definitely made it to this part of the code for sure."), NULL, &alert);
RunStandardAlert(alert, NULL, &userItemHit);
break;
}