drawRect: doesn't get called when printing
drawRect: doesn't get called when printing
- Subject: drawRect: doesn't get called when printing
- From: Ron Ballesteros <email@hidden>
- Date: Mon, 28 Feb 2005 15:57:51 -0800
Hi List,
I'm trying to add a print functionality in my non-doc based app. When I click print in my application, I get no data in the print result. Using a bunch of NSLogs I noticed that the drawRect: of my custom view never gets called during the print process.
What I am trying to print is the data that is shown in a window with two table views, where table view 2 shows the related data from the selected item in table view 1. So I created a custom view that will print the data in a group like manner.
Below is what is called when they click print in the toolbar item in the window controller. Reading the documentation, I am under the understanding that printOperationWithView: calls print on the actual view and
therefore calls drawRect.
- (id)sender {
NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo];
NSPrintOperation *printOp;
TrainingView *printView = [[TrainingView alloc] initWithTrainingProfile: trainingArray printInfo: printInfo];
printOp = [NSPrintOperation printOperationWithView: printView printInfo: printInfo];
[printOp setShowPanels: YES];
[printOp runOperation];
[printView release];
}
I'm hoping someone can give me some ideas on what to look for as to why the drawRect: of my custom view is not getting called. Do I need to check if the current graphic context is for printing or for the screen?
Thanks.
-r
_______________________________________________
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