Change tooltips in user view

I have a sample project:

http://ericgorr.net/cocoadev/tooltip.zip

What I would like to do is define a single tooltip for the entire view, but be able to change the tooltip when the cursor moves inside the view.

Is there any way to do this? Is there a way to make it hide the current tooltip and display a new one when called like: stringForToolTip: point: userData :?

I could create my own window that simulates a real tooltip, but I wanted to make sure that nothing was built in to support this.

+3
source share
1 answer

MAAttachedWindow:
http://mattgemmell.com/source/
.

NSView .
NSView () .
, .

- (void)mouseMove:(NSEvent *)theEvent {

    NSPoint mousePositionInWindow = [theEvent locationInWindow];

}

- (void)mouseDown:(NSEvent *)theEvent {

}

- (void)mouseDragged:(NSEvent *)theEvent {

}

- (void)mouseUp:(NSEvent *)theEvent {

}

:

: , . . , , .

NSView . NSView NSView, .

. -, , , : , . , , .

, , . :)

+2
source

All Articles