Add a function to NSTextField like NSComBox's complete
Add a function to NSTextField like NSComBox's complete
- Subject: Add a function to NSTextField like NSComBox's complete
- From: "Calvin (Yunfeng) Hou" <email@hidden>
- Date: Wed, 14 Jul 2004 17:20:49 -0400
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.