• 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: Opening drawer by default
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening drawer by default


  • Subject: Re: Opening drawer by default
  • From: Chuck Norris <email@hidden>
  • Date: Sat, 19 Jan 2002 11:35:51 -0800

I had a situation similar to this with a Sheet I wanted to pop up after the window opened. I ended up using a Timer that checked for window visibility before acting. I would re-launch the timer until the window was visible, then launch my sheet.

Andreas, I'm curious about your suggestion of
[NSApp performSelector:@selector(open) withObject:drawer afterDelay:0.0]

Is there anything that is substantially different from using timers? The problem I ran into was that since I wanted the delay to be a short as possible, I ran the risk of firing before the system was ready. I handled this by re-launching the timer on a 0.1 second interval until my window was visible ([myWindow isVisible]).

The need for polling like this makes me think there must be (or should be) a better way to do this. I would prefer that the system notify me when I can take these sorts of actions rather than having to poll. But of course I wan't able to find anything suitable. I suspect that some AppKit guru on this list might be able to suggest a better way.

Chuck

At 9:07 AM -0800 1/19/02, Yong Lee wrote:
Well, yes. Actually, what I mean was, as a beginner, I tried Andy's suggestion verbatim:

[NSApp performSelector:@selector(open) withObject:MyDrawer afterDelay:1.0];

and I got "NSApp does not respond to perforSelector:". Only when I looked up performSelector: I realized it's an NSObject method so I could do something like this.

[self performSelector:@selector(open) withObject:MyDrawer afterDelay:1.0];

Yong Lee

On Saturday, January 19, 2002, at 08:53 AM, Finlay Dobbie wrote:


On Saturday, January 19, 2002, at 04:45 pm, Yong Lee wrote:

Thanks Andy. It works  except performSelector:withObject:afterDelay belongs to NSObject.

NSApp is an NSObject...

-- Finlay
_______________________________________________
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.


References: 
 >Re: Opening drawer by default (From: Yong Lee <email@hidden>)

  • Prev by Date: Re: Changing the "on" color of an NSButton
  • Next by Date: Printing and margins
  • Previous by thread: Re: Opening drawer by default
  • Next by thread: Re: Opening drawer by default
  • Index(es):
    • Date
    • Thread