• 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: Hiding and showing a window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hiding and showing a window


  • Subject: Re: Hiding and showing a window
  • From: David Remahl <email@hidden>
  • Date: Sat, 16 Feb 2002 23:45:04 +0100

> Greetings,
>
> I have a faceless application which needs to pop up a small display
> window at certain events. Preferably, the window will slide out from
> under the menu bar.
>
> I have managed to make a window with a transparent background, which
> floats above all else. However, I cannot figure out how to hide and show
> the window, much less slide it around.

This method of NSWindow will do what you want:

- setFrame:(NSRect)frameRect display:(BOOL)displayFlag
animate:(BOOL)animateFlag

First position the window above the menu bar. Then use the
setFrame:display:animate: method to set a new rect, of the same size, same x
coordinate, but with a lower y coordinate.

> Furthermore, I cannot create an NSRect. This code:
> NSRect myRect;
>
> Results in the following error:
> SBAppController.m:23: illegal statement, missing `;' after `NSRect'

What's on the line before that?

> I tried several variations on this, including making a pointer to an
> NSRect. It would seem that NSRect is important in moving windows. Why
> doesn't this work?
>
> Thank you.

/ David
_______________________________________________
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: Hiding and showing a window
      • From: Andreas Monitzer <email@hidden>
References: 
 >Hiding and showing a window (From: David McCabe <email@hidden>)

  • Prev by Date: Hiding and showing a window
  • Next by Date: NSMutableData doesn't support dataWithBytesNoCopy properly
  • Previous by thread: Hiding and showing a window
  • Next by thread: Re: Hiding and showing a window
  • Index(es):
    • Date
    • Thread