NSTextView's autoresizingmask
NSTextView's autoresizingmask
- Subject: NSTextView's autoresizingmask
- From: Brian Amerige <email@hidden>
- Date: Thu, 24 May 2007 18:38:55 -0400
Hello List,
I've got an NSSplitView which has two subviews, an NSScrollView and a
WebView. The scrollView's documentView is an NSTextView. All of this
is created programatically.
Ordinarily I'd have the textView's autoresizingMask set to
NSViewWidthSizable. However, when I animate (using NSViewAnimation)
changes to the frames of the subviews, the resizing is choppy and
crashes --- but only on Intel Macs
However, I have found a hackish solution which drastically increases
the performance of the animation on Intel Macs (no longer crashes,
very smooth). If I animate the scrollView, textView, and webView
using NSViewAnimation, and set the textView's autoresizingMask to
NSViewNotSizable right before starting the animation, these lag-
issues disappear. After the animation has finished I set the
textView's autoresizingMask back to NSViewWidthSizable (that way
manual, user-induced resizes of the splitview and window can
appropriately resize the textView.)
Worth noting, even with NSViewWidthSizable as the autoresizing mask,
resizing the subviews of the splitview manually (by dragging the
splitview, for example), are fluid and not choppy at all on both PPC
and Intel.
Also worth noting, I have considered adjusting the viewAnimation's
blocking mode, from the default NSAnimationBlocking to
NSAnimationNonblocking. This results in the same behavior -- good
performance on PPC macs, but crashes on Intel Macs.
My question is as follows: is there a better solution to this?
Without much thought I can see a multitude of caveats that come from
adjusting the textView's autoresizing mask, so I'd definitely prefer
not to do this.
Cheers,
Brian.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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