• 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
Non-highlighting NSButton, or how to control NSButton highlights
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Non-highlighting NSButton, or how to control NSButton highlights


  • Subject: Non-highlighting NSButton, or how to control NSButton highlights
  • From: jkp <email@hidden>
  • Date: Mon, 22 Aug 2005 11:00:30 +0100

Quick and easy one I'm sure.

I've written an NSButton subclass that is supposed to act like a hyperlink - I know I could have done this with NSAttributedString's link attribute and an NSTextField subclass, but it seemed like more work to implement some of the other functionality i was after - this way i get the target/action functionality anyway.

The question i have is how I can control the Highlighting behaviour in the way i want. I find the NSButton documents pretty confusing on this subject - there are various options for telling the cell how it behaves when highlighted, or when its state changes, but many times i have applied the masks and have seen no results.

I have two problems i need to solve.

1: I am tracking the mouse as it enters the cell to provide a mouse- over, but as soon as I do this I get a highlight applied to the cell when I mouseover. I am not doing anything except calling [self setNeedsDisplay:YES] and leaving the drawing to super. How can i stop this behaviour?

2: The button has an NSImage attached to it - I want to prevent the image going dark when it has been clicked - again i have found no way of doing this...the various masks seem to have no effect.

I have come to the conlusion that I will need to subclass NSButtonCell to get the effect i am after here but i have to say this seems like a lot of work just to turn off something that I would have thought would be more easily configurable.

Am I missing a trick?

Many thanks

JKP
_______________________________________________
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


  • Prev by Date: Does anyone have working sample code?
  • Next by Date: replaceTextStorage: and retain/release woes
  • Previous by thread: Does anyone have working sample code?
  • Next by thread: replaceTextStorage: and retain/release woes
  • Index(es):
    • Date
    • Thread