printing a different representation than what is on the screen
printing a different representation than what is on the screen
- Subject: printing a different representation than what is on the screen
- From: Dave Reed <email@hidden>
- Date: Thu, 20 Jan 2011 09:24:03 -0500
I'm working on a document-based application that has a couple tabs. Most of the tabs contain NSTableViews, NSTextFields, etc.
I want to provide a way for the user to print the data contained in them (just text, possibly with some grid lines), but not the actual table view. I've read through (admittedly fairly quickly) the "Printing Topics for Cocoa" document from Apple but it is more geared towards printing what you see on the screen.
I also may want to print different data depending on which tab the user is on.
What is the appropriate way to do this? Do I override drawRect: for each tab such as:
- (void)drawRect:(NSRect)r {
if ( [NSGraphicsContext currentContextDrawingToScreen] ) {
[super drawRect:r]
}
else {
// somehow send drawing instructions for the text I want
}
}
or do I somehow create an off screen view that I "draw" the text and grid lines into?
A pointer in the correct direction or pointers to other documentation or examples would be appreciated.
Thanks,
Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden