Re: Lazy calculation of tooltip text

2018-07-06 Thread Jens Alfke



> On Jul 6, 2018, at 8:22 AM, Jonathan Taylor  
> wrote:
> 
> Any suggestions on how I might supply tooltip text dynamically, when the 
> tooltip is about to display?

@protocol NSViewToolTipOwner 
- (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag 
point:(NSPoint)point userData:(nullable void *)data;
@end

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Lazy calculation of tooltip text

2018-07-06 Thread Jonathan Taylor
I have a UI item (text field) that displays a tooltip when the user hovers over 
it. However, the information to be displayed in the tooltip is dynamic and 
relatively expensive to compute. At the moment the tooltip is bound to a string 
property which I manually update twice a second. It seems that the right way to 
handle all this would be to compute the information only when I know the 
tooltip is about to display. However, googling and searching of headers has not 
led me to a way to do this. It seems that NSTextView has a method 
textView:willDisplayToolTip:forCharacterAtIndex: which would seem to offer the 
functionality I want. However, I can’t find anything equivalent for other view 
types.

Any suggestions on how I might supply tooltip text dynamically, when the 
tooltip is about to display?

[University of Glasgow: The Times Scottish University of the Year 2018]
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com