• 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
How to make NSButton not invert (gray) when tracking mouse?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to make NSButton not invert (gray) when tracking mouse?


  • Subject: How to make NSButton not invert (gray) when tracking mouse?
  • From: tyler <email@hidden>
  • Date: Mon, 6 Aug 2001 20:59:28 -0700

Hey there,
I have and NSButton and it has a main and alternate image and is set up to be a Toggle type button. Click it and it's one picture, click again and it's the other. That all works great and I like it.

What I want it to do is switch to the other picture while the mouse is being tracked in the button (switching back and forth as you move the mouse in/out of the button rect). I have this working

[[mybtn cell] setHighlightsBy: NSContentsCellMask]; for those who haven't seen this.


However, the effect is ruined by the "selecting" of the button rectangle that also happens. Looks like it's making the picture darker (gray). Is there a way to turn off this part of the tracking so the only tracking is my two images going back and forth?

I tried things like:

[[mainSwitch cell] setCellAttribute: NSCellLightsByContents to: 1]; // or YES
[[mainSwitch cell] setCellAttribute: NSChangeGrayCell to: 0]; // or NO
[[mainSwitch cell] setCellAttribute: NSCellLightsByGray to: 0]; // or NO


with no luck. Always it's darkening the images (and switching them like I want, just want to get rid of that darkening of the image during tracking).

Any ideas on how to get this to work?

Thanks in advance for any tips/tricks you might be able to offer!

tyler


  • Follow-Ups:
    • Anyone have a fix?: How to make NSButton not invert (gray) when tracking mouse?
      • From: tyler <email@hidden>
  • Prev by Date: Re: Beginners question: how to use this list ?
  • Next by Date: Re: NSTimer fires ~0.0045 seconds early?
  • Previous by thread: Re: AppleScript and error messages
  • Next by thread: Anyone have a fix?: How to make NSButton not invert (gray) when tracking mouse?
  • Index(es):
    • Date
    • Thread