Skip navigation.
 
mlProblems printing an NSScrollView
FROM : Dave Camp
DATE : Thu Jul 20 21:05:48 2006

My utility application needs to print out about two pages of status 
data that I've captured from a hardware device. The printout I need 
is essentially like a form; lots of "Field:  Value" type stuff.

I've started implementing this as a custom (offscreen) view in the 
root of my nib. The view is as wide as a sheet of paper and very 
tall. It's got a ton of NSTextFields that are connected to my 
controller. The view is currently taller than a single page and it 
correctly prints as two pages. So far so good (I think).

The problem is that to fit all the data, the view needs to be taller 
than my monitor. My attempt at fixing this was to embed all the 
subviews in an NSScrollView and make the content view as large as 
needed. This solves my problem in IB as I can scroll around the 
content and edit fields as needed.

What I can't seem to do is get the scroll view resized larger 
programatically before I print. I've tried calling setFrame: and 
setBounds on the NSScrollView inside my view, but it always prints 
the same size as it is in IB. The goal here was to resize the 
NSScrollView to be two pages high and then print, which would 
hopefully yield the correct printed results.

Is there a better way to solve this problem?

Why isn't setFrame or setBounds resizing my NSScrollView?

Thanks,
Dave

Related mailsAuthorDate
No related mails found.