• 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
Add a function to NSTextField like NSComBox's complete
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Add a function to NSTextField like NSComBox's complete
      • From: Daniel Todd Currie <email@hidden>
  • Prev by Date: Re: Basic Concepts
  • Next by Date: WebDocumentText
  • Previous by thread: Re: coordinate confusion, please help!
  • Next by thread: Re: Add a function to NSTextField like NSComBox's complete
  • Index(es):
    • Date
    • Thread