problems with uitree and interruptions
1 view (last 30 days)
Show older comments
Hi,
I have a gui with an uitree created with different nodes. The thing is that when I press on each of the nodes some plotting code is executed on a figure via the mousepressed_callback function. The problem comes when the user clicks very fasts on the nodes of the tree until at some point, the mousepressed functions is executed before the plotting of the previous selected node has been finished producing this error:
Error using handle.handle/get Invalid or deleted object.
Error in gui_mainfcn (line 238) if strcmpi(get(gui_hFigure, 'Visible'), 'on')
I believe that this is happening because the mousepressed_callback function interrupts the plotting process and when it comes back, matlab is unable to find the handle figure. Is there a way of setting the interruptions to off for the uitree?? any idea of how to solve this??
Thanks a lot!
Ivan
0 Comments
Answers (1)
Image Analyst
on 30 Apr 2015
Once they click on the control, disable it until you're done with the operation. Then they won't be able to start a new click event until you're done with the last one.
2 Comments
Image Analyst
on 30 Apr 2015
set(handles.uitree, 'Enable', 'off');
Or maybe it's 0 instead of off - not sure.
See Also
Categories
Find more on Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!