Re: Multi-line NSTokenField
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