• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Button with a "mouseover" alternate image?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Button with a "mouseover" alternate image?


  • Subject: Re: Button with a "mouseover" alternate image?
  • From: Chad Weider <email@hidden>
  • Date: Sun, 15 Jan 2006 15:53:41 -0600

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:

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).


Chad Weider
email@hidden
_______________________________________________
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


  • Follow-Ups:
    • Re: Button with a "mouseover" alternate image?
      • From: "Theodore H. Smith" <email@hidden>
References: 
 >Button with a "mouseover" alternate image? (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: CORE DATA: setImage (transient) and setImageData (binary) accessors don't fire.
  • Next by Date: Autocomplete NSComboBox without the button.
  • Previous by thread: Button with a "mouseover" alternate image?
  • Next by thread: Re: Button with a "mouseover" alternate image?
  • Index(es):
    • Date
    • Thread