How to make NSButton not invert (gray) when tracking mouse?
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