Re: Leopard NSTableView Cell and single click editing
Re: Leopard NSTableView Cell and single click editing
- Subject: Re: Leopard NSTableView Cell and single click editing
- From: Corbin Dunn <email@hidden>
- Date: Tue, 27 Nov 2007 16:52:51 -0800
On Nov 26, 2007, at 9:13 AM, Stephane Sudre wrote:
On 26 nov. 07, at 16:47, j o a r wrote:
On Nov 26, 2007, at 7:00 AM, Manfred Schwind wrote:
Problem is: it is not called! It seems to depend on the SDK I link
to; not the system where to app runs on (why?). For various
reasons I can not link against the 10.5 SDK, nor can I use Xcode
3. I am using Xcode 2.5 and using 10.4u SDK.
This is a commonly used technique for ensuring compatibility with
existing apps that might depend on the old behaviour. For more
info, see the "Backward Compatibility" comments at the top of that
same release note.
Actually, it looks more like a bug in this case.
If the single edit click is enabled on applications linked with the
10.4 SDK (and I tend to believe they are from what I can see), then
- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:
(NSRect)cellFrame ofView:(NSView *)controlView should be called in
this case too.
If it's not, then it's a bug.
Well, it technically isn't a bug, and what you are saying won't work.
Let me explain:
hitTestForEvent:inRect:ofView: is correctly implemented in the base
AppKit cell classes: NSCell, NSTextFieldCell, etc.
So, there is no way to know that the method is correctly implemented
for a given cell subclass just by it checking if it is present (since
it is always present). Because of that, we have to check for the app
to be linked against Leopard.
Mani, in regard to your original problem -- how did you limit an
editing session on Tiger? I'm guessing you would have overridden this
method:
- (void)editColumn:(NSInteger)column row:(NSInteger)row withEvent:
(NSEvent *)theEvent select:(BOOL)select
and not called super if the particular area clicked (based on
theEvent's mouse location) wasn't in your text area. However, you must
have been doing something else, since you are having a problem.
Side note: there is a way to disable the single-click editing
behavior, however, it should be considered a last resort. Single-click
editing is nice for consistency on Leopard, and apps that move away
from that will make it more difficult for users to use that particular
app (ie: your app). Having said that, you can do this type of code,
which is very unsupported and may break in future releases: if ([table
respondsToSelector:@selector(_setEditOnSingleClick:)]) { [table
_setEditOnSingleClick:NO]; }. If for some reason you really need this
code, please do file a bug requesting that such a method be made public.
--corbin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden