Re: Position of NSStatusItem
Re: Position of NSStatusItem
- Subject: Re: Position of NSStatusItem
- From: "[nexUmoja] Fabian Jäger" <email@hidden>
- Date: Tue, 20 Nov 2007 23:59:38 +0100
Unfortunately it does not work for me. I checked with a completely
new project and my code from below... again I only get kind of local
coordinates and not screen coordinates :-(
Do I need any additional includes?
Fabian
nexUmoja.org
On 20.11.2007, at 23:34, Joachim Deelen wrote:
As far as I can see the only difference between your and my code is
that I'm using a fixed length of the StatusItem instead of the
NSVariableStatusItemLength.
--
Joachim
Am 20.11.2007 um 23:03 schrieb [nexUmoja] Fabian Jäger:
Now I use this code:
// instantiate statusbar-icon
NSStatusBar *systemBar = [NSStatusBar systemStatusBar];
theItem = [systemBar statusItemWithLength:
NSVariableStatusItemLength];
[theItem retain];
NSView *tmpView = [[NSView alloc] initWithFrame:NSMakeRect(0.0,
0.0, [theItem length], [[theItem statusBar] thickness])];
[theItem setView:tmpView];
NSRect globalOrigin = [[[theItem view] window] frame];
NSLog(@"%f/%f", globalOrigin.origin.x, globalOrigin.origin.y);
[theItem setView:nil];
[tmpView release];
The output is: "0.000000/0.000000" ... don't really know what's
wrong with the code :-(
Fabian
nexUmoja.org
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden