Re: Formatting NSView for printing...
Re: Formatting NSView for printing...
- Subject: Re: Formatting NSView for printing...
- From: Colin Doncaster <email@hidden>
- Date: Wed, 9 Aug 2006 15:58:25 +1000
Thanks Omar -
That helps it making what I want to do easier. I think I gave up too
soon, I'm reading the Cocoa Drawing reference guide and I imagine
it's more what I need. My problem is that I have a Core Data
Document Based App and the Document Window has various table views
and controls. I don't want to print those directly, I'd rather
reformat all the output into something more appropriate to print.
Colin.
On 9-Aug-06, at 3:50 PM, Omar Qazi wrote:
On Aug 8, 2006, at 10:23 PM, Colin Doncaster wrote:
I current have a function in MyDocument that returns an NSView*
that is my printed view. Is there any recommended ways I can
construct my view? Is it save just to NSView *printView =
[ NSView new ]; and then draw on it what I want, can I even do
this? Any help would be appreciated, there doesn't seem to be
much info on printing anything other than already formatted
NSView's in the documentation.
Do you mean the function returns the contentView of the NSWindow
and you want to add more content (such as controls, or other views)
to the document window? If you do, then you can use the addSubview:
method to do so like so:
//Sample code to add new button to document
NSButton *myButton = [[NSButton alloc]initWithFrame:NSMakeRect
(100,100,100,100)];
[[myDocument printedView]addSubview:myButton];
Omar Qazi, CEO
ROFL Software :)
_______________________________________________
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