Re: NSTextView and NSTextContainer size clipping area

2011-05-09 Thread Rimas M.
As far as I remember, text container inset sets margins from both sides: left and right and/or top and bottom. If text container position is important according to the text view, this will not work. 2011/5/8 Kyle Sluder kyle.slu...@gmail.com On May 8, 2011, at 3:27 AM, Дмитрий Николаев

Re: NSTextView and NSTextContainer size clipping area

2011-05-08 Thread Дмитрий Николаев
Code in Custom NSTextView - (void) drawRect: -- [super drawRect:dirtyRect]; NSBezierPath* aPath = [NSBezierPath bezierPath]; [aPath moveToPoint:NSMakePoint(100, 100)]; [aPath lineToPoint:NSMakePoint(500, 100)]; [aPath stroke]; --- Custom textview resize policy set, so it resizes

Re: NSTextView and NSTextContainer size clipping area

2011-05-08 Thread Ross Carter
Try wrapping the call to super like this: [NSGraphicsContext saveGraphicsState]; [super drawRect:rect]; [NSGraphicsContext restoreGraphicsState]; On May 8, 2011, at 6:27 AM, Дмитрий Николаев wrote: Code in Custom NSTextView - (void) drawRect: -- [super drawRect:dirtyRect];

Re: NSTextView and NSTextContainer size clipping area

2011-05-08 Thread Kyle Sluder
On May 8, 2011, at 3:27 AM, Дмитрий Николаев blacklit...@gmail.com wrote: Custom textview resize policy set, so it resizes in all dimensions with container. This is code for custom NSTextView - - (void) setFrameSize:(NSSize)newSize { [super setFrameSize:newSize];

Re: NSTextView and NSTextContainer size clipping area

2011-05-08 Thread Дмитрий Николаев
I will try this solution too. Thanks for suggesting. 08.05.2011, в 21:33, Kyle Sluder написал(а): On May 8, 2011, at 3:27 AM, Дмитрий Николаев blacklit...@gmail.com wrote: Custom textview resize policy set, so it resizes in all dimensions with container. This is code for custom NSTextView

Re: NSTextView and NSTextContainer size clipping area

2011-05-07 Thread Дмитрий Николаев
But when i try draw a line in NSTextView, it limited to frame of text container too. 06.05.2011, в 22:56, Ross Carter написал(а): On May 6, 2011, at 2:40 AM, Дмитрий Николаев wrote: If there are any possibility to draw inside text view but outside of text container ? It depends on who

Re: NSTextView and NSTextContainer size clipping area

2011-05-07 Thread Ross Carter
We need to see your code. In general, any drawing code after the call to super in the textView's drawRect method will draw. But maybe you are trying to do something different. On May 7, 2011, at 3:13 AM, Дмитрий Николаев wrote: But when i try draw a line in NSTextView, it limited to frame of

NSTextView and NSTextContainer size clipping area

2011-05-06 Thread Дмитрий Николаев
Hello! I found very interesting behavior of text container inside NSTextView. When i set size of container so it less than size of NSTextView frame and try draw any figures in NSTextView drawRect: , all my figures clipped to size of text container. So, frame size of NSTextView allows me to use

Re: NSTextView and NSTextContainer size clipping area

2011-05-06 Thread Ross Carter
On May 6, 2011, at 2:40 AM, Дмитрий Николаев wrote: If there are any possibility to draw inside text view but outside of text container ? It depends on who is doing the drawing. NSTextView is an NSView subclass and you can override drawRect: just like any NSView. The Cocoa text system,