Skip navigation.
 
ml(no subject)
FROM : David Wu
DATE : Thu Nov 21 21:16:05 2002

>> 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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
ml(no subject) David Wu Nov 21, 21:16
ml(no subject) Aidas Dailide Nov 25, 16:36
ml(no subject) Jean Bovet Dec 1, 11:51
mlRe: (no subject) Chris Ridd Dec 1, 12:03