LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Double Event Problem ?

Solved!
Go to solution

Hi

 

I need someones help to understand and help solve this problem.

I got a tree on the main top level panel, the tree and the panel have a Right Click Event.

The event then run a menupopup and the both menus are loaded on the main panel.

The problem is when i right click on the tree it runs the menupopup but the right click event is been sent to the panel as well which then runs the other menupopup.

 

Can you explain to me why this is happening and if there is a way to swallow the event been passed to the panel ?

Help share your knowlegde
0 Kudos
Message 1 of 4
(3,207 Views)
Solution
Accepted by Shako

This is the expected behaviour while responding to callbacks. As can be seen in the online help,

When users click with the right mouse button anywhere or a panel, an EVENT_RIGHT_CLICK event occurs, and is sent to the callback function associated with the panel, as well as to the callback function associated with the control over which the mouse click took place. 

 

The order in which the events are received from various UI objects is the following (online help, topic "Precedence of callback functions"):

  • For control operation events:
    1. Control callback
    2. Main callback
    3. Panel callback (keypress and mouse events only)
    4. Main callback

 

To swallow a UI event simply return a non-zero value from the callback (in your case the control callback so that the event is not passed to the panel callback).

Message Edited by Roberto Bozzolo on 09-23-2009 08:55 AM


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 2 of 4
(3,202 Views)

Swallowing the event worked. Thanks alot.

Help share your knowlegde
0 Kudos
Message 3 of 4
(3,194 Views)
You're welcome!


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 4 of 4
(3,190 Views)