I have a problem to solve, and I am a beginner in LabWindows.
I built a panel that has 2 buttons. All this buttons call the same CVICALLBACK function. During the EVENT_LEFT_CLICK event I have to know which button was pressed.
It follows the function that I implemented to do the test.
int CVICALLBACK pressedIndicatorButton (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
int val;
switch (event) {
case EVENT_LEFT_CLICK:
GetCtrlVal(panel, control, &val);
switch (val) {
case INDICATOR_BUTTONCHART:
MessagePopup("Alert", "Alert");
break;
case INDICATOR_BUTTONKNOB:
break;
}
break;
}
return 0;
}
The constant name of the buttons are BUTTONCHART and BUTTONKNOB. The contant name of the panel that the buttons are in is INDICATOR.
What is it wrong in the code?
Thank you in advance!