Re: How do you know when a modal operation has finished (in terms of Obj-C code) ?
Re: How do you know when a modal operation has finished (in terms of Obj-C code) ?
- Subject: Re: How do you know when a modal operation has finished (in terms of Obj-C code) ?
- From: email@hidden
- Date: Wed, 14 Feb 2007 18:44:59 +0100 (CET)
- Importance: Normal
>The docs for the method you're calling are very clear about how to do
>this.
Er, not quite for an amateur like me. After reading that doc,
I modified my code as follows (trying to stick to the doc as much
as possible), by taking the original document class as delegate
and adding a documentDidRunModalPrintOperation: delegate method :
- (void)printShowingPrintPanel:(BOOL)showPanels
{
[myView modifyTemporarilyJustForPrinting];
// Construct the print operation and setup Print panel
NSPrintOperation *op = [NSPrintOperation
printOperationWithView:myView
printInfo:[self printInfo]];
[op setShowPanels:showPanels];
// Run operation, which shows the Print panel if showPanels was YES
[self runModalPrintOperation:op
delegate:self
didRunSelector:@selector(documentDidRunModalPrintOperation:)
contextInfo:NULL];
[myView restoreToNormal];
}
- (void)documentDidRunModalPrintOperation:(NSDocument *)document
success:(BOOL)success
contextInfo:(void *)contextInfo
{
[myView restoreToNormal];
}
I get an error message saying that the selector
documentDidRunModalPrintOperation: is
not recognized, even though I did declare that delegate method in the
header file. What's wrong
with the code above ?
Ewan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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