I just can’t seem to get this right…for the life of me I can’t get SetText() to work. I want this to change the labels on the buttons when either the first or second are pressed. It sets the text fine when they’re created but for some reason it doesn’t here and I’m not sure why. Any help would be greatly appreciated.
// BUTTONS
// -------
if ((GET_MSG (msg) == kC_COMMAND) && (GET_SUBMSG (msg) == kCM_BUTTON)) {
switch (parm1) {
case kButtonStart: // Start Button
{
if (fControlStart) {
fControlStart = false;
fControlPause = true;
fCalcConf->fPause = false;
fControlButton[1]->SetState (kButtonUp); // Enable PAUSE
fControlButton[0]->SetText (kHotControlButtonText[3]); // Change START to STOP
fControlButton[1]->SetText (kHotControlButtonText[1]); // Change RESUME to PAUSE
ReadCalcConf();
ReadPlotConf();
ReadOutConf();
// fStartTime = time(time);
break;
}
else {
fControlStart = true;
fCalcConf->fPause = true;
fControlButton[1]->SetState (kButtonDisabled); // Disable PAUSE
if (fControlPause = false) {
fControlPause = true;
}
/* fControlButton[1]->SetText (new TGHotString (kControlButtonText[1])); // Change RESUME to PAUSE
fControlButton[0]->SetText (new TGHotString (kControlButtonText[0])); // Change STOP to START
*/
break;
}
}
case kButtonPause: // Stop Button
{
if (fControlPause) {
fControlPause = false;
fControlStart = true;
fCalcConf->fPause = false;
/* fControlButton[0]->SetText (new TGHotString (kControlButtonText[0])); // Change STOP to START
fControlButton[1]->SetText (new TGHotString (kControlButtonText[4])); // Change PAUSE to RESUME
*/
break;
}
else {
fControlPause = true;
fControlStart = false;
fCalcConf->fPause = true;
/* fControlButton[0]->SetText (new TGHotString (kControlButtonText[3])); // Change START to STOP
fControlButton[1]->SetText (new TGHotString (kControlButtonText[1])); // Change RESUME to PAUSE
*/
break;
}
}
case kButtonQuit: // Quit Button
{
CloseWindow();
break;
}