• 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: Multi-line NSTokenField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multi-line NSTokenField


  • Subject: Re: Multi-line NSTokenField
  • From: Marc Monguio <email@hidden>
  • Date: Tue, 23 May 2006 12:13:35 +0200

What's the basic recipe for implementing an NSTokenField that spans multiple lines like the address fields in Mail.app?

IBOutlet NSTokenField *tokenField;

//make your class delegate of the tokenField and implement the following method
- (void)controlTextDidChange:(NSNotification *)aNotification;
{
[self resizeTokenField];
}


//This implements the live resizing
- (void)resizeTokenField;
{
NSRect oldTokenFieldFrame = [tokenField frame];
NSSize cellSize= [[tokenField cell] cellSizeForBounds:[tokenField bounds]];
[tokenField setFrame:NSMakeRect(oldSeedsFrame.origin.x,
oldTokenFieldFrame.origin.y+ oldTokenFieldFrame.size.height-cellSize.height,
oldTokenFieldFrame.size.width,
cellSize.height)];
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >Multi-line NSTokenField (From: Graham <email@hidden>)

  • Prev by Date: RE: Subclassing NSSlider and NSSliderCell
  • Next by Date: Bug in PDFKit's PDFDocument attributes?!
  • Previous by thread: Multi-line NSTokenField
  • Next by thread: Re: Multi-line NSTokenField
  • Index(es):
    • Date
    • Thread