[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

removing subviews from a window



I am trying to re-use a window that has quite a few subviews. Perhaps the
source of my troubles is that two of these views are scrolling views and
gave associated scrollers, etc. What I am trying to do is to remove the
subviews first and then add my new versions of the subviews. I have tried
various methods: remove-subviews to remove them all at once, map-subviews
to remove one at a time, and I have surrounded the calls with
without-interrupts (I'm not sure why, but I was getting desperate!).

What happens is that an error is returned that one of the subviews is not
a subview of my original window. But it was before I tried to remove it!
The act of removing one or more of the previously (and the ordering is
determined by the functions I used to get the subviews) removed subviews
has somehow caused the subview to become disconnected from its container!

Is the order of removal signifcant?
Am I missing something more basic?

I finally gave up and simply close the window and open a new identical one
with the new subviews. Of course, I would prefer my intended approach.

Any help would be appreciated. (I can supply more specific detail if
necessary, of course.)

Martin

-------------------------------------------------------------------------------
Martin Stanley                                  Department of Computer Science
mts@ai.toronto.edu  -or-                        University of Toronto
mts@ai.utoronto.ca                              Kings College Circle
                                                Toronto, Ontario
-------------------------------------------------------------------------------