Scott
Posts:
13
Registered:
10/31/12
|
|
Re: cla clearing handles from the wrong axis
Posted:
Feb 24, 2013 2:31 PM
|
|
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kgcns6$ds9$1@newscl01ah.mathworks.com>... > "Scott" wrote in message <kgcfgf$mbu$1@newscl01ah.mathworks.com>... > > > When I do this, it does exactly what it is supposed to do for the second figure, but it also, somehow, changes the array of patch handles for the main GUI window too. Suddenly, many of them are no longer valid handles which messes up downstream GUI functions. (before, a call to ishandle for the handles array gives all 1s. After, there are strings of 0s). > > I think you confuse: MATLAB does not change the handles of patches, it actually left unchanged those patches, which is no longer exist since you clear the axes. > > You need to manage those handles coherently (using GUIDATA function, for example). It's your job to do so, MATLAB won't do it for you. > > Bruno
My language was imprecise. I cleared the axes of the axes on the 2nd figure. But I explicitly specified that axis:
cla(axis_figure2,'reset')
So it shouldn't touch any handles of patches that are associated with the primary axis, or so I would assume.
And yet, I have an array of 500 or so handles to patch objects that are all children of the primary axis. If I do:
disp(ishandle(primaryAxisHandles_array)') cla(axis_figure2,'reset') disp(ishandle(primaryAxisHandles_array)')
I get output like the following:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 (for the first disp()) 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 (for the 2nd disp()
the important thing is that these handles should (or at least I'd like them to) have nothing at all to do with the axis_figure2
|
|