Re: Force to show ToolTip
Re: Force to show ToolTip
- Subject: Re: Force to show ToolTip
- From: Alexei Kosut <email@hidden>
- Date: Tue, 13 May 2003 14:13:15 -0500
On Saturday, May 10, 2003, at 01:57 PM, Giovanni Donelli wrote:
Hello Gurus!
I have a NSMatrix with NSButtonCell Cells, and each of these Cells
has a tooltip associated.
I wanna to force the tooltip to appears as soon as my mouse is over a
cell.
Is there a way "to ask" a NSView to programmattically shows its
tooltip?
Not that I know of, but Cocoa's "context-sensitive help" tags look very
similar to tooltips, so you can fake it, e.g.:
// set view's context help to its tooltip, display the context help,
and remove it
NSHelpManager *helpManager = [NSHelpManager sharedHelpManager];
[helpManager setContextHelp:[[[NSAttributedString alloc]
initWithString:[view toolTip]] autorelease] forObject:view];
[helpManager showContextHelpForObject:view locationHint:[NSEvent
mouseLocation]];
[helpManager removeContextHelpForObject:view];
Hope this helps!
--
Alexei Kosut <email@hidden> <
http://cs.stanford.edu/~akosut/>
_______________________________________________
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.