(no subject)
(no subject)
- Subject: (no subject)
- From: David Wu <email@hidden>
- Date: Thu, 21 Nov 2002 12:16:05 -0800
in .m file:
- (IBAction)print:(id)sender
{
NSView *newView;
NSPrintOperation *printOp;
printOp = [NSPrintOperation printOperationWithView:inLetterView];
newView = [customePrintView printAccessoryView];
[printOp setAccessoryView:newView];
[printOp setShowPanels:YES];
[printOp runOperation];
}
when i compile and run i got the 'accView2' does not respond to
'printAccessoryView'
Which is probably right. customePrintView is an instance of the
accView
class. That class does not have instance method called
printAccessoryView,
at least according to the debugger.
You want to create a new view and then set it as the accessory view.
Instead of the second line try:
newView = [[[customePrintView alloc] init] autorelease];
Jonathan
Thank you for the input. Actually what I did was:
- (IBAction)print:(id)sender
{
NSView *newView;
NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo];
NSPrintOperation *printOp;
printOp = [NSPrintOperation printOperationWithView:inLetterView];
//newView = [customePrintView printAccessoryView];
customePrintView = [[NSView alloc] init];
newView = customePrintView;
[printOp setAccessoryView:newView];
[printOp setShowPanels:YES];
[printOp runOperation];
}
And now there is no bug reports, and I can see the application's name
shown up in the pop-up menu of the print pane, but when I select it the
view is not shown up!
accView is the NSView object class I designed and is archived in the
nib file of MainMenu.nib
Then I have .customePrintView points to accView, (the rest is just as
descibed in the .m above)
Is there a method/methods I need to call to draw the accessory view
before I set the accessory view??
Thnx again guys
_______________________________________________
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.