Link to home
Start Free TrialLog in
Avatar of ronenmagid1
ronenmagid1Flag for United States of America

asked on

Cocoa Application - Tooltip

On my Mac/Cocoa I'm programmatically displaying a bitmap - projecting it using using "drawInRect" onto one of my NSView instances.

I'd like this bitmap to have a tooltip.

As I'm new to Mac programming, I'd appreciate any pointer you may have.
ASKER CERTIFIED SOLUTION
Avatar of pgnatyuk
pgnatyuk
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ronenmagid1

ASKER

pgnatyuk: my bitmap is not a control, it's an arbitrary area on my view. Would this make creating a tooltip for this rectangle more complicated?
I do not see your code. If it is about Cocoa (you make Mac OS application), and if you have only the window (NSWindow), I think, you need to make a custom view (NSView). NSView knows how to work with the tooltips. You will set all parameters and it will work. It is a bit late here to test right now. For any control, as you see, it is a trivial task to add a tooltip.

Have you read this article?
http://projects.autonomy.net.au/ai/chrome/site/resource/ebooks-programming/cocoa/cocoa-programming/0672322307_ch20lev1sec2.html

 
Try this code:
[myView setToolTip:@"This is a test view"];

I didn't test it.

I took it from here:
http://www.mail-archive.com/cocoa-dev@lists.apple.com/msg48345.html
Thanks. That did it.