Re: re Hiding controls and another question
Re: re Hiding controls and another question
- Subject: Re: re Hiding controls and another question
- From: John Saccente <email@hidden>
- Date: Sat, 2 Mar 2002 00:25:05 -0600
On Friday, March 1, 2002, at 11:45 PM, Graeme Hiebert wrote:
On Friday, March 1, 2002, at 09:14 PM, John Saccente wrote:
Not quite yet! :o)
I think this:
if ( ![gViewDict objectForKey:self] )
should be
if ( ![gViewDict objectForKey:[self description]] )
Thanks. You caught a glimpse of my first failed attempt. I forgot to
fix one instance apparently. :^)
Anyway, one possible problem might be that if the superview is
destroyed, the detached subview will be left floating in limbo, no?
Plus, any messages sent to the hidden subview will go to the proxy and
will be lost (like a setStringValue: or something.) Perhaps you'd
want a special NSView subclass for your proxy object which was aware
of its disembodied doppelganger and would forward messages accordingly?
True, it's not perfect. Messages should still go to the original
object though, I think, unless they were
Oh yeah. I guess for the most part the messages would still go to the
proper objects, regardless of what views they were (or weren't) shacking
up with at the time. I suppose you'd still have to be careful about
methods that invoked [self superview], [self window] and the like.
going through the responder chain. Like you say, using a special View
class instead of a global dictionary would pretty much take care of the
biggest issues: memory management.
It's still pretty cool, though, that you've got the flexibility in Cocoa
to extend the functionality of the frameworks like this, even if it is
for something as dumb as making parts of your UI disappear ;o)
John Saccente
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.