• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: re Hiding controls and another question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: re Hiding controls and another question


  • Subject: Re: re Hiding controls and another question
  • From: John Saccente <email@hidden>
  • Date: Fri, 1 Mar 2002 23:14:36 -0600

On Friday, March 1, 2002, at 10:14 PM, Graeme Hiebert wrote:

On Friday, March 1, 2002, at 07:42 AM, Dennis De Mars wrote:

The topic is often described as "hiding NSViews" so you might want to search on that, or simply on "hiding." I can assure you that the topic came up at least twice in the past month.

I agree there should be a facility to make controls, or NSViews in general, invisible. Since many people seem to expect this feature, and pretty much every other GUI framework I've ever seen has it, I think Apple should just add it in a future update. (As you can see, some other people feel differently, but they don't have to use it). Until that happens, if ever, I have a few comments for you:
<snip>

Here's what 20 minutes can buy you. No guarantees -- I'm not yet all that experienced in real-world Cocoa -- but it seems to work for me.

<http://homepage.mac.com/graeme/.cv/graeme/Public/ViewHiding.tar.gz-binhex.
hqx>

Now can we move on? :^)


Not quite yet! :o)

I think this:

if ( ![gViewDict objectForKey:self] )

should be

if ( ![gViewDict objectForKey:[self description]] )


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?

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.

  • Follow-Ups:
    • Re: re Hiding controls and another question
      • From: Graeme Hiebert <email@hidden>
References: 
 >Re: re Hiding controls and another question (From: Graeme Hiebert <email@hidden>)

  • Prev by Date: Re: re Hiding controls and another question
  • Next by Date: Re: re Hiding controls and another question
  • Previous by thread: Re: re Hiding controls and another question
  • Next by thread: Re: re Hiding controls and another question
  • Index(es):
    • Date
    • Thread