Re: Formatting NSView for printing...
Re: Formatting NSView for printing...
- Subject: Re: Formatting NSView for printing...
- From: Omar Qazi <email@hidden>
- Date: Tue, 8 Aug 2006 22:50:34 -0700
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