Re: Command-click table in background app
Re: Command-click table in background app
- Subject: Re: Command-click table in background app
- From: Bill Cheeseman <email@hidden>
- Date: Wed, 31 May 2006 09:14:41 -0400
- Thread-topic: Command-click table in background app
on 2006-05-31 8:19 AM, Shaun Wexler at email@hidden wrote:
> On May 31, 2006, at 5:00 AM, Bill Cheeseman wrote:
>
>> I can't make this work. I've created a subclass of NSScrollView that
>> overrides -acceptsFirstMouse:, and I've made my subclass the
>> scrollview's
>> "custom class" using IB. But my subclass's -initWithFrame: and
>> -acceptsFirstMouse: methods are never called (unless I call the latter
>> explicitly with an NSLog call on the table view's superview's
>> superview (to
>> get past the intervening clip view).
>>
>> Is there some trick to making a table's scrollview use a subclass?
>
> Objects created in Interface Builder are archived, and the designated
> initializer for NSCoding will be called when the nib is loaded. You
> need to use -initWithCoder: and (in your Debug build) test for the
> proper subclass.
I'm not sure I understand what you're saying, but I think you may not be
correct, because...
I've now gotten part way to my goal by using IB to set my drawer's table
view as initial first responder. Some old posts to the list indicated that
it might be necessary to do this in my window controller's -awakeFromNib,
but doing it in IB works seems to work. My NSScrollView subclass is
recognized, and now its override of -acceptsFirstMouse: is called when I
click on the table with my app frontmost.
However, -acceptsFirstMouse: is called AFTER -tableView:shouldSelectRow: and
AFTER my -selectRow action method. I haven't thought through the
implications of that yet. Maybe all it means is that -acceptsFirstMouse:
acts as a veto authority after the selection is attempted.
But it still doesn't work when my app is in the background and I
Command-click on the table. I suspect that I also have to subclass
NSClipView and override its -acceptsFirstMouse: to return YES. I won't be
able to try that until tonight.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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