LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

System locks when callback creates control that can call itself.

I have a program which creates a popup from the main panel. The popup has a canvas and two buttons which are created on the fly. Both have the callback function "X". Calling X with the event double left click deletes both original buttons and replaces them with two more with "X" as the callback function. I can trace all this through debug code.
The program locks up but will respond after running another program ( eg Spy).
SetActive or ProcessSystemEvents does not solve the problem.I tried DisplayPanel for both.
The system refuses to break in these lock ups.
Smells of Windows/ redraw problems. Has anyone experienced a similar problem or have any ideas?.
Best Regards
Ken
0 Kudos
Message 1 of 3
(3,007 Views)
If I were you, I will put the deletion of controls and creation of new ones in a separate function called using PostDeferredCallback: this way you should avoid the problems that can arise by deleting a control in its own callback and so on.

Hope this helps
Roberto


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 3
(3,007 Views)
Late addition: since the control interested are more than one, you can pass the control ID in the callbackData parameter.


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