07-07-2011 12:27 AM
Callback does not respond to EVENT_COMMIT. Why not?
Responds to EVENT_MOUSE_POINTER_MOVE.
int CVICALLBACK DISPLAY_COAS (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
int i;
switch (event) {
case EVENT_MOUSE_POINTER_MOVE:
case EVENT_COMMIT:
Parsing_result[0] = '\0';
for (COMPANY_INDEX = 0; COMPANY_INDEX < NUMBER_OF_COMPANIES; COMPANY_INDEX++) {
Number_of_CofA_entries = Company_list[COMPANY_INDEX].CofA_map_SIZE;
for (CofA_map_INDEX = 0; CofA_map_INDEX < Number_of_CofA_entries; CofA_map_INDEX++) {
for (i = 0; i <CofA_map[COMPANY_INDEX][CofA_map_INDEX].level; i++) {
strcat(Parsing_result," ");
}
strcat(Parsing_result,CofA_map[COMPANY_INDEX][CofA_map_INDEX].Account_name);
strcat(Parsing_result,"\n");
}
}
break;
}
MessagePopup ("Parsing result", Parsing_result);
return 0;
}
Solved! Go to Solution.
07-07-2011 01:39 AM - edited 07-07-2011 01:40 AM
Which mode is your control set to? To have it respond to EVENT_COMMIT events it must be set in hot mode; every other mode prevents it from firing commit events. Also, which control is this callback installed on?
In every case, MOUSE_POINTER_MOVE is too general a event for this task: it is fired on every mouse movement on the control; you can use EVENT_LEFT_CLICK instead.
07-07-2011 02:53 AM
Thank you for your prompt response. It seems that part of the problem was that the line MessagePopup ("Parsing result", Parsing_result);
should have been inserted above the break; so the popup would only occur when an EVENT_COMMIT had occurred. The way I had it (below the break;) I would see the popup as soon as an EVENT_MOUSE_POINTER_MOVE occurred and there was never an opportunity to respond properly to an EVENT_COMMIT. Pilot error
Best regards,
cegcs
07-07-2011 02:56 AM
I would give a kudo but I don't know how
07-07-2011 04:57 AM
Thank you for asking: you simply have to click on the highlighted symbol
07-07-2011 08:29 AM
Done. Thank you. I also experimented with the control mode and it is as you say.
cegcs
07-08-2011 06:08 PM
Roberto,
I'll give ya Kudos on this even if it is not my post! 🙂 Thanks for the info! Cheers!
ChipB aka ASIC LabRat