"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kgdtjn$kb7$1@newscl01ah.mathworks.com>...
> "Scott" wrote in message <kgdsag$guq$1@newscl01ah.mathworks.com>...
>
> >
> > So what I'm not understanding then about your answer are a few things:
> >
> > Why does it only touch some of the handles of the main figure window/axis?
>
> cla() does not touch anything that _YOU_ have stored with guidata. It simply delete the children of the axes. If you have stored the handles previously, after clearing the axes, they become then invalid.
>
> MATLAB GUI don't know anything about you have stored and they are later deleted. YOu should make sure the storage is consistent with the graphics you have manipulated.
>
> Bruno
Shouldn't it only clear children of the specified axis?
> "Scott" wrote in message <kgdsag$guq$1@newscl01ah.mathworks.com>...
>
> >
> > So what I'm not understanding then about your answer are a few things:
> >
> > Why does it only touch some of the handles of the main figure window/axis?
>
> cla() does not touch anything that _YOU_ have stored with guidata. It simply delete the children of the axes. If you have stored the handles previously, after clearing the axes, they become then invalid.
>
> MATLAB GUI don't know anything about you have stored and they are later deleted. YOu should make sure the storage is consistent with the graphics you have manipulated.
>
> Bruno
Shouldn't it only clear children of the specified axis?