Re: NSTextView moves when being resized ???
Re: NSTextView moves when being resized ???
- Subject: Re: NSTextView moves when being resized ???
- From: Reinhard Segeler <email@hidden>
- Date: Sat, 29 Aug 2009 18:13:27 +0200
Hallo Anders,
did you receive my message below, because that solves the problem. I
have checked, that in a testproject.
The explanation is: If you set a new max width/height its calculated
and drawn from the origin, which is the lower left edge of your view.
You find more details in the NSView documentation
The coordinate-system for a view starts with the lower left corner,
not at the upper left. There is command, that sets the coordinate
system to the upper left corner, but I can't find it right now. But I
guess, that the first info is what you need to know.
Reinhard
Am 29.08.2009 um 12:38 schrieb Anders Lassen:
Hi,
I am working on a custom view that consists of a column of several
NSTextViews. In between, there are graphics and some other stuff
that require special editing.
Therefore I cannot use a single NSTextView.
The NSTextView must adopt its height to the content. This works fine
using the code as listed below.
But the problem is, that the NSTextView control moves downwards when
the size is changed.
textView = [[NSTextView alloc] initWithFrame:NSMakeRect(100, 100,
300, 200)];
[self addSubview:textView];
[textView setVerticallyResizable:YES];
[textView setAutoresizingMask NSViewHeightSizable];
[textView setMinSize:NSMakeSize(0.0, 100.0)];
[textView setMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)];
I have read about others having the same problem, but I did not find
a solution.
Note that the NSTextView is a subview to a custom view, that is the
content view of a NSScrollView. But this does not matter - I think.
Hope someone can help on this.
Kind regards,
Anders Lassen
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden