Re: [Q] Status Bar icon and Tiger
Re: [Q] Status Bar icon and Tiger
- Subject: Re: [Q] Status Bar icon and Tiger
- From: Nathan Kinsinger <email@hidden>
- Date: Tue, 1 Jul 2008 13:34:03 -0600
On Jul 1, 2008, at 8:53 AM, JongAm Park wrote:
Hello, all.
Can anyone help me to figure out an issue regarding to a status menu
width issue on Tiger?
The project I work on is for the Tiger and the Leopard.
I used this code to set an icon, which is longer horizontally than
vertically, and it worked on the Leopard.
NSStatusBar *statusBar = [NSStatusBar systemStatusBar];
// Because it is a eps version of our company's name, it is longer
horizontally. So, I used
// NSVariableStatusItemLength instead of NSSquareStatusItemLength
statusBarItem = [[statusBar statusItemWithLength:
NSVariableStatusItemLength] retain];
[statusBarItem setImage:inactiveCompanyImage];
[statusBarItem setEnabled:YES];
[statusBarItem setToolTip:@"Blah blah.."];
[statusBarItem setHighlightMode:YES];
It works nicely with the Leopard, but our support team people say
that it doesn't with the Tiger.
I'm suspicious if they use a small status bar program for displaying
CPU temperature, etc.
(During the ToolBox era, I noticed such a case.. )
I would appreciate any help.
Thank you.
In my status menu I set the width a little larger than the image, I
seem to recall needing to do that to make the spacing between items
look right, but I'm not sure now. In the line below change the number
at the end to make things look right (8.0 is what I'm using).
statusBarItem = [[statusBar statusItemWithLength:
([inactiveCompanyImage size].width + 8.0)] retain];
There is also a setLength: method if you change the image size later
in your program.
--Nathan
_______________________________________________
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