scaleUnitSquareToSize: weirdness
scaleUnitSquareToSize: weirdness
- Subject: scaleUnitSquareToSize: weirdness
- From: Keith Blount <email@hidden>
- Date: Thu, 6 Jan 2005 03:27:27 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hello,
I am trying to use scaleUnitSquareToSize: to implement
a zoom feature for my view, but I just cannot get it
to update correctly. I have tried (I think)
everything, and it is now driving me slightly crazy...
My view is a subclass of NSView, which has two
subviews: on the right, an NSTextView, and on the left
a custom view that is used for adding marginal notes
that attach themselves to the text in the text view.
The whole view is then contained inside an
NSScrollView.
This is what I am trying to do to resize (as an
initial test):
[[self textView]
scaleUnitSquareToSize:NSMakeSize(2.0,2.0)];
[[self marginView]
scaleUnitSquareToSize:NSMakeSize(2.0,2.0)];
I have tried putting this code in various places - in
the initialisers, in awakeFromNib:, and so forth - and
always get the same problem, which is this: everything
scales very nicely, but the text view is not resized
to fit the enclosing scroll view (I have the
autoresizing masks set properly). So if you type, the
text will go off the right of the view. If you resize
the window, however, the text view gets resized
correctly and everything looks fine. This suggests to
me that some message isn't being sent somewhere. I
have tried setting setNeedsDisplay: and display for
all the relevant views, but still the size doesn't get
update until you resize the window, and I have also
tried various combination of setFrame: and setBounds:,
none of which have helped.
(Incidentally, I am scaling the margin and text views
separately rather than scaling the view that holds
them - which is the scroll view's document view -
because I don't want the margin itself to double in
width.)
Can anybody see what I am missing here? It's probably
really obvious, but I would be really grateful if
someone could tell me how to get my view to update its
frame properly after the scale has been set.
Many thanks for any help in advance,
Keith
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - What will yours do?
http://my.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