|
|
Disabling click-through for cocoa controls?
|
|
|
|
Mac Enthusiast
Join Date: Dec 2001
Status:
Offline
|
|
The Aqua HIG recommend against click-through for destructive items, yet the buttons I create in interface builder by default support click through.
I'd like to change that, but I don't see any obvious way of doing that except to write a bunch of laborious code to enable and disable controls as a window receives and loses the focus.
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Nov 2002
Location: Rockville, MD
Status:
Offline
|
|
this is a good question. Anyone know the answer?
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status:
Offline
|
|
Override your control's acceptsFirstMouse: method so it always returns "NO". See [NSView acceptsFirstMouse:].
|
Geekspiff - generating spiffdiddlee software since before you began paying attention.
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Jul 2001
Location: Qu�bec, Canada
Status:
Offline
|
|
Originally posted by smeger:
Override your control's acceptsFirstMouse: method so it always returns "NO". See [NSView acceptsFirstMouse:].
Great, but I have a better solution. I've made a class called MFClickThroughDisabler that you just attach to a control in IB and it disable and enable attached control automagically when the window change state preventing click through and giving the correct visual feedback.
If someone want it, just send me an email.
[edit: typo]
(
Last edited by Michel Fortin; Jul 21, 2003 at 08:59 AM.
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|