• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [newbie]: resizing a view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >[newbie]: resizing a view (From: J Tichenor <email@hidden>)

  • Prev by Date: Re: Unwanted scaled line width
  • Next by Date: Re: Determining the size of a directory Part 2
  • Previous by thread: [newbie]: resizing a view
  • Next by thread: Unwanted scaled line width
  • Index(es):
    • Date
    • Thread