• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setting myself as fieldeditor's delegate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >setting myself as fieldeditor's delegate? (From: Seth Delackner <email@hidden>)

  • Prev by Date: Programatically opening a NSComboBox?
  • Next by Date: Re: web services?
  • Previous by thread: Re: setting myself as fieldeditor's delegate?
  • Next by thread: Adding a method makes a class abstract?
  • Index(es):
    • Date
    • Thread