• 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: Invalid window error for a status bar item popup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invalid window error for a status bar item popup


  • Subject: Re: Invalid window error for a status bar item popup
  • From: Jeffrey Mattox <email@hidden>
  • Date: Tue, 18 Feb 2003 22:51:31 -0600

4:05 AM +0100 2/19/03, Andreas Mayer wrote:
Actually, let me try again ... ;)

Do you use a custom view for your status item? If so, did you try to use [[statusItem view] window] as the window for your event?

Currently, I am creating my own window and view (that makes it a custom view, right?), but I have also tried

[[theStatusBarItem view] window]

My status bar item comes from:

theStatusBarItem = [bar statusItemWithLength:NSVariableStatusItemLength]

If I simply use the window and view already associated with that status bar menu item, then the popup does not appear under the status bar, even if I do setFrame for both the window and the view. However, the error message I originally complained about does not happen using this scheme.

The only way I've found to get the menu to appear in the right spot is to create my own window and view, then setFrame to (0,0,anything,anything) (apparently the w and h do not matter), and then the menu appears according to the location:mouseLocation specified in theEvent.

I've also tried using the window associated with theStatusBarItem, and then creating my own view. The position is still wrong.

So, either I can position the popup and I get the error message, or I don't get the error message but the popup is way off base.

Jeff
_______________________________________________
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: Invalid window error for a status bar item popup (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: image mask
  • Next by Date: simple event question
  • Previous by thread: Re: Invalid window error for a status bar item popup
  • Next by thread: NSString doubleValue and zero
  • Index(es):
    • Date
    • Thread