Re: Invalid window error for a status bar item popup
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.