RE: Scrolling a view containing two subviews (NSTextView weirdness)
RE: Scrolling a view containing two subviews (NSTextView weirdness)
- Subject: RE: Scrolling a view containing two subviews (NSTextView weirdness)
- From: Keith Blount <email@hidden>
- Date: Fri, 7 Jan 2005 03:43:19 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Okay, I have figured out part of the problem, but
would really appreciate some help with the
logistics...
To recap, I have a custom NSView that contains an
NSTextView and a margin view for notes on the left of
it. I am placing this inside a scroll view, but am
having problems getting the scrolling view to act
really nicely.
The problem is simple: I just have to make sure that
my custom view is always just the right size to fit
both the margin view and the text view - no bigger or
smaller than it needs to be. And for this I am
listening for NSViewFrameDidChangeNotifications and
updating things accordingly. But the trouble is that
updating the size of the views becomes recursive, so
that the view will always end up bigger than it needs
to be, like this:
- The text view should always have its minSize.height
set to the height of its superview, so that the user
can always click in it no matter where he/she has
scrolled.
- the superview has to be set to have the biggest
height out of the scroll view's clip view, the margin
view, and... the text view.
This feedback between the NSView and the text view is
what's causing me problems. For instance: if the
scrollview is enlarged, the custom view will get
resized so that it is big enough to fit it. This will
cause the text view's minSize to get updated so that
the text view is big enough to be always clickable
within the view. But now, if you resize the scollview
and make it smaller, the custom view will remain the
same because it will be stuck at the text view's new
height...
Does anybody have any ideas on how I can get out of
this deadlock? My head seems to be going in circles...
Many thanks for any help in advance,
Keith
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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