Re: Resizing custom subclassed NSTextView

2011-06-09 Thread Joe White
Oh man, this sounds exactly what I need. Thanks for the pointer! Cheers, Joe On 9 June 2011 15:37, Ross Carter wrote: > On Jun 9, 2011, at 6:11 AM, Joe White wrote: > > > I think it would solve all my problems if I was able to do > auto-completion, etc... with NSTextField. I don't have enough k

Re: Resizing custom subclassed NSTextView

2011-06-09 Thread Ross Carter
On Jun 9, 2011, at 6:11 AM, Joe White wrote: > I think it would solve all my problems if I was able to do auto-completion, > etc... with NSTextField. I don't have enough knowledge of the Cocoa API to > make an informed decision yet. If you are not familiar with the field editor, I recommend you

Re: Resizing custom subclassed NSTextView

2011-06-09 Thread Joe White
Hi Gary, You're right, sizeToFit was not correct. I ended up following this to get NSTextView to resize correctly - http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/TextLayout/Tasks/StringHeight.html#//apple_ref/doc/uid/20001809-CJBGBIBB I'm not sure if you seen the other po

Re: Resizing custom subclassed NSTextView

2011-06-09 Thread Joe White
Hi Ross On 9 June 2011 01:51, Ross Carter wrote: > On Jun 8, 2011, at 7:19 PM, Joe White wrote: > > > Basically, the interface is separate editable objects that are usually > single symbols with a few arguments included. This means that the each > object is always one line high and usually not t

Re: Resizing custom subclassed NSTextView

2011-06-08 Thread Gary L. Wade
If you're fine with a single line that grows horizontally, try using an NSTextField object in single-line mode, and utilize textDidChange:, calling sizeToFit on the object. The method sizeToFit is a method of NSControl, not NSTextView or its superclasses. I'm suggesting all this from memory, tho

Re: Resizing custom subclassed NSTextView

2011-06-08 Thread Ross Carter
On Jun 8, 2011, at 7:19 PM, Joe White wrote: > Basically, the interface is separate editable objects that are usually single > symbols with a few arguments included. This means that the each object is > always one line high and usually not that wide. > > I started off using NSTextField (which

Re: Resizing custom subclassed NSTextView

2011-06-08 Thread Joe White
Hi Ross, thanks for replying. I wish I didn't have to subclass NSTextView, but from my understanding it seems like I have to. Basically, the interface is separate editable objects that are usually single symbols with a few arguments included. This means that the each object is always one line hig

Re: Resizing custom subclassed NSTextView

2011-06-08 Thread Ross Carter
On Jun 6, 2011, at 6:29 PM, Joe White wrote: > Hi, > > I currently have a custom subclassed NSTextView as a subview of an NSView > (which is its delegate). > > I'm trying to to dynamically resize the minimum width of the NSTextView > based on the string input so that view resizes to fit (the hei

Resizing custom subclassed NSTextView

2011-06-08 Thread Joe White
Hi, I currently have a custom subclassed NSTextView as a subview of an NSView (which is its delegate). I'm trying to to dynamically resize the minimum width of the NSTextView based on the string input so that view resizes to fit (the height is always one line). This is the NSTextView init: -