problems with uitree and interruptions

1 view (last 30 days)
Ivan Cordon
Ivan Cordon on 29 Apr 2015
Commented: Image Analyst on 30 Apr 2015
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

Answers (1)

Image Analyst
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
Ivan Cordon
Ivan Cordon on 30 Apr 2015
Thank you for your answer. I have tried to hide the tree during the execution of the plotting and it does not work. I looked for the disable function and I did not find anything. What is the coding to disable the tree?
Ivan
Image Analyst
Image Analyst on 30 Apr 2015
set(handles.uitree, 'Enable', 'off');
Or maybe it's 0 instead of off - not sure.

Sign in to comment.

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!