Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Automatic Row Selection



I don't know of an automatic way, but you might end up writing a very simple
subclass of NSTableView, overriding its -acceptsFirstMouse: method to return
YES.  If I don't misunderstand the reference, that should allow you process
the initial click instead of just becoming first responder.  Here's the text
of the reference for that method:

- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent

Overridden by subclasses to return YES if the receiver should be sent a
mouseDown: message for theEvent, an initial mouse-down event over the
receiver in its window, NO if not. The receiver can either return a value
unconditionally, or use the location of theEvent to determine whether or not
it wants the event. NSView's implementation ignores theEvent and returns NO.
Override this method in a subclass to allow instances to respond to initial
mouse-down events. For example, most view objects refuse an initial
mouse-down event, so the event simply activates the window. Many control
objects, however, such as NSButton and NSSlider, do accept them, so the user
can immediately manipulate the control without having to release the mouse
button.

And the link:
<http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Obj
C_classic/Classes/NSView.html#//apple_ref/doc/uid/20000014/BCIDIGDA>

Topher

-----Original Message-----
From: applescript-studio-bounces+tophu=email@hidden
[mailto:applescript-studio-bounces+tophu=email@hidden] On Behalf
Of John Mistler
Sent: Saturday, April 23, 2005 8:18 PM
To: email@hidden
Subject: Automatic Row Selection

I have two separate windows with table views in each of them.  I would like
to be able to enable clicking between the two tables in such a way that a
click on a row of one table will highlight that row without the extra click
currently required to change the window's first responder to the table.  The
end result would be the ability to highlight a row in one table with one
click, then to highlight a row of the other table with one click, etc., back
and forth.  I hope that question makes sense to everyone, and if so, how can
I eliminate that extra click currently required?

Thanks,

John

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Automatic Row Selection (From: John Mistler <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.