Re: [newbie]: resizing a view
Re: [newbie]: resizing a view
- Subject: Re: [newbie]: resizing a view
- From: Aaron Fothergill <email@hidden>
- Date: Mon, 25 Oct 2004 14:16:38 +0100
I'm doing something similar and having odd problems too. I'm doing this to resize the view to pageWidth x pageHeight
myBounds = [self bounds];
[[self superview] setNeedsDisplayInRect:myBounds];
myBounds.size.height = pageHeight;
myBounds.size.width = pageWidth;
[self setBounds:myBounds];
[self setFrame:myBounds];
(note the setNeedsDisplayInRect for the superview, this or setNeedsDisplay on self causes the view to re-draw)
however, when the view re-draws its new bounds height is larger than pageHeight (currently pageWidth is fixed) by roughly the amount that was added on but actually containing a fractional value.
Aaron
_____________________________
Aaron Fothergill : MD / Lead Coder
Strange Flavour Ltd
email@hidden
http://www.strangeflavour.com
On 25 Oct 2004, at 09:23, J Tichenor wrote:
I have a custom NSView that I am drawing text into, to generate a report. I set the size of the window that the view lives in, as well as the view itself, to the imageablePageBounds of the sharedInfo in NSPrintInfo -- essentially the size of the drawable space for printing.
I want to use this same view to print as well as display my report. When the number of lines of text exceed the height of the view, I need my NSView to grow to accommodate the new size. What I can't figure out how to do is grow the size of the view. I have tried -setFrame and -setBounds and neither expands the size of the view, kicking in the NSScroll.
Does this make sense? Once again, I'm sure I am missing something fundamental, but haven't found anything in docs or archives to tell me what I should be doing.
Any help would be appreciated...
~j~
James Tichenor
VFX Supervisor
AIM: email@hidden
(07779) 256 103
http://www.lehopictures.com/the_joint/
_______________________________________________
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
_______________________________________________
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