LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Callback does not respond to EVENT_COMMIT seems to require EVENT_MOUSE_POINTER_MOVE

Solved!
Go to solution

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;
}

 

0 Kudos
Message 1 of 7
(3,817 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 7
(3,814 Views)
Solution
Accepted by topic author cegcs

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 errorSmiley Sad

 

Best regards,

 

cegcs

0 Kudos
Message 3 of 7
(3,741 Views)

I would give a kudo but I don't know howSmiley Sad

0 Kudos
Message 4 of 7
(3,739 Views)

Thank you for asking: you simply have to click on the highlighted symbol

 

kudo.PNG



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 7
(3,730 Views)

Done. Thank you. I also experimented with the control mode and it is as you say.

 

cegcs

0 Kudos
Message 6 of 7
(3,720 Views)

Roberto,

 I'll give ya Kudos on this even if it is not my post! 🙂 Thanks for the info! Cheers!

ChipB aka ASIC LabRat 

0 Kudos
Message 7 of 7
(3,711 Views)