Re: Add a function to NSTextField like NSComBox's complete
Re: Add a function to NSTextField like NSComBox's complete
- Subject: Re: Add a function to NSTextField like NSComBox's complete
- From: Daniel Todd Currie <email@hidden>
- Date: Wed, 14 Jul 2004 15:27:27 -0700
Have a look at DTCPathView here:
http://los.dtcurrie.net/code/
-- DTC
On 2004 Jul 14, at 14:20, Calvin (Yunfeng) Hou wrote:
Hi All,
I'm trying to add a function to NSTextField just like the "completes"
in
NSComboBox. When using selectWithFrame to select characters in the
string,
the string dispears from the textField. But the text is selected, and
the
selected text can be replaced by new keyboard inputing. How to display
the
string which should be partly selected?
The code is like following,
NSString *curStr = [textField stringValue];
NSRect aRect = [textField frame];
NSTextFieldCell *tcell = [textField cell];
NSText * editor = [textField currentEditor];
id dele = [editor delegate];
[tcell selectWithFrame:aRect inView:filledFirstName editor:editor
delegate:dele start:1 length:1];
Thanks a lot.
Calvin
_______________________________________________
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.
_______________________________________________
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.