Re: setting myself as fieldeditor's delegate?
Re: setting myself as fieldeditor's delegate?
- Subject: Re: setting myself as fieldeditor's delegate?
- From: Stéphane Sudre <email@hidden>
- Date: Mon, 17 Mar 2003 14:36:18 +0100
On Monday, March 17, 2003, at 09:12 AM, Seth Delackner wrote:
I want all text fields in a window to select all of their text
whenever the user clicks with the mouse. I read the archives, and it
being a bit late I am just getting frustrated. In awakeFromNib I > have:
NSWindow* w = [field1 window];
[[w fieldEditor:YES forObject:field1] setDelegate: self];
Just doesn't work. My delegate methods are never called. I don't get
it.
It's not surprising.
The delegate of the fieldEditor is modified as soon as another editable
text field is selected either via:
- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView
editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent *)theEvent
or
- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView
editor:(NSText *)textObj delegate:(id)anObject start:(int)selStart
length:(int)selLength
What you may want to do is to subclass NSTextField and its mouseDown:
method.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.