Issues with callbacks and large handle structures?
Show older comments
I am working on a gui, and encountered a strange problem. When I pass 'h' to a uicontrol callback and put a breakpoint in the callback, I find that only the first 30 handles are present in the callback instance of 'h'. (i.e. h.figure, h.CCUpanel, h.gammacontrol, etc.)
Since the callback was called by a later uicontrol, errors were generated when I attempted to refer to it.
Has anyone seen this before and/or know how to correct it or work around it?
Thanks, Sean
4 Comments
Jan
on 14 Nov 2011
It is impossible to know the reason without seeing the code, Perhaps you have defined the callback function such, that it contains the only partially created handles struct? Then use the function GUIDATA to get the most recent value.
Sven
on 15 Nov 2011
I agree with Jan, and I can almost guarantee the following:
If you can replicate your problem in a *small* function (ie, with all unnecessary code removed so that it has only code that causes issues), you will actually find and fix the problem before we do.
Image Analyst
on 15 Nov 2011
Perhaps you're only seeing part of it in the popup window when you hover over it but if you type handles into the command window or look at it in the variable editor you will see the rest of the members. Is that a possibility? Either that or like the others said you added members to handles but didn't do anything to make sure those additions are kept around for the next function that expects to see them.
Sean
on 15 Nov 2011
Accepted Answer
More Answers (0)
Categories
Find more on Interactive Control and Callbacks 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!