Adding accessory view to print panel
Adding accessory view to print panel
- Subject: Adding accessory view to print panel
- From: Rob In der Maur <email@hidden>
- Date: Mon, 25 Aug 2003 17:47:27 +0200
Hi all,
I'm trying (with thelp from previous posts on this list) to add a
accessory view to my print panel.
In it simplest explanation you define a view in a NIB file and attach
this to the print panel by using
[printOperation setAccessoryView:myView];
First question I have is in which NIB you define this view, especially
when using a document based application? For the moment I've defined
the view in the MyDocument.nib file of which the File's Owner is the
main window controller. I've defined an outlet in the controller class
to the view and also an accessor such that I can return the view from
other classes.
Now when I code something like this:
NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo];
NSPrintOperation *printOp;
printOp = [NSPrintOperation printOperationWithView:myView
printInfo:printInfo];
[printOp setAccessoryView:[myController myAccessoryView];
[printOp setShowPanels:YES];
[printOp runOperationModalForWindow:[myView window]
delegate:self
didRunSelector:NULL
contextInfo:NULL];
.... nothing happens in the Print Panel dialog. No extra pop up menu
choice identifiying the name of my application becomes available. So,
why not?
However, when I code something like this....
NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo];
NSPrintOperation *printOp;
printOp = [NSPrintOperation printOperationWithView:myView
printInfo:printInfo];
NSView *customAccessoryView = [[[NSView alloc]
initWithFrame:NSMakeRect(10, 10, 300, 300)] autorelease];
[customAccessoryView addSubview:[myController myAccessoryView]];
[printOp setAccessoryView:customAccessoryView];
[printOp setShowPanels:YES];
[printOp runOperationModalForWindow:[myView window]
delegate:self
didRunSelector:NULL
contextInfo:NULL];
... I get an extra pop up menu in the Print Panel dialog. However,
selecting this show an empty view, not the view (myAccessoryView) I
defined.
So my second question is, what am I doing wrong? I have the suspicious
feeling I just don't correctly access the view in my NIB....
Any help appreciated...
cheers,
- Rob In der Maur
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.