Auto-resizing NSTextField
Auto-resizing NSTextField
- Subject: Auto-resizing NSTextField
- From: Nik Youdale <email@hidden>
- Date: Fri, 23 Dec 2005 17:41:15 +1100
Hi,
I have made a custom view which just consists of an NSView subclass,
that displays a coloured background, and then an NSTextView in the
middle. I would like the TextView to always be just the right size
to fit in the text that it contains. So basically when you type, it
grows and when you delete, it shrinks (horizontally) I will then need
to pass this size on to the NSView to resize that as well.
I tried using [textView sizeToFit] but got no results. Also, the text
must also occupy only one line at all times, and it should not be
able to scroll or wrap.
If there is a simple method that i need i need to call that would be
great, but also if it involves running a check to see how many pixels
on screen the text occupies, and then resizing the textView and the
NSView every keystroke programatically that is also just fine.
Any help would be greatly appreciated!
Merry Christmas everyone!
- Nik
_______________________________________________
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