3
我想知道屏幕可可:我想知道屏幕上的狀態欄圖標的位置
-(void)awakeFromNib{
statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain];
NSBundle *bundle = [NSBundle mainBundle];
statusImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"r" ofType:@"png"]];
statusHighlightImage = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"rh" ofType:@"png"]];
[statusItem setImage:statusImage];
[statusItem setAlternateImage:statusHighlightImage];
[statusItem setTitle:@"APP"];
[statusItem setToolTip:@"You do not need this..."];
[statusItem setHighlightMode:YES];
NSRect rect = [[[statusItem view] window ] frame];
NSLog(@"%f",rect.origin.y);
}
這樣做的狀態欄圖標的位置,並沒有得到
NSRect rect = [[[statusItem view] window ] frame];
NSLog(@"%f",rect.origin.y);
謝謝!它是如此! – 2012-04-18 04:21:06