Re: Button with a "mouseover" alternate image?
Re: Button with a "mouseover" alternate image?
- Subject: Re: Button with a "mouseover" alternate image?
- From: "Theodore H. Smith" <email@hidden>
- Date: Mon, 16 Jan 2006 12:55:34 +0000
On 15 Jan 2006, at 21:53, Chad Weider wrote:
On Jan 15, 2006, at 2:49 PM, Theodore H. Smith wrote:
I'm trying to get an NSbutton, to have something like an
"alternateImage", except that it is a "mouseOverImage".
So this image will be displayed instead of the normal image, when
the mouse is over.
Any ideas how this is done?
You would probably want to use tracking rects. See the developer doc
"Handling Tracking-Rectangle and Cursor-Update Events in Views".
When the mouse rolls over a tracking rect you'll be sent a message
to mouseEntered: and then, when it leaves you'll get a message sent
to mouseExited:
Any idea how I'd draw the images and handle them? I know about
mouseOver events already.
Also, btw does anyone know how to get an NSView which accepts
NSDrag stuff, to display a blue outline inside itself, during the
drag operation? I can't figure it out.
Similarly, you can use dragginEntered: and draggingExited: and
draggingEnded: to take care of drawing the focus ring (these are
always called - don't use tracking rects).
I'd like to know how to draw the focus ring, though. I'm already
using draggingEntered and all that.
Is there some prefered recommended manner for drawing the ring? Or
must I just draw it with some custom drawing code?? If so, then I can
say that I'm not surpised that it seems every Mac app's drag border
looks different from every other's!!
Shame there is no standard drawing routine, eh?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden