Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Cocoa: how to print with Accessory Panel

Cocoa: how to print with Accessory Panel
Thread Tools
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
Mar 4, 2004, 11:26 PM
 
I'm trying to print using an accessory panel in my print dialogue. My panel has radio buttons to print records of different types.

The panel shows up fine, but how do I get at that data before it tries to print? As soon as I click Print (or Preview) it just goes ahead and prints. I would like it to stop, to allow me to modify the data, and then I want to call a method to carry on with the actual printing.

Here's my code:
view = [[PrintedList alloc] initWithListItems:itemsToPrint printInfo:[self printInfo]];
printOp = [NSPrintOperation printOperationWithView:view printInfo:printInfo];
[printOp setShowPanels:flag];
if (flag)
{
[printOp setAccessoryView:[printAccessoryPanel contentView]];
}
[printOp runOperation];
[view release];
[itemsToPrint release];
Thanks for any and all suggestions.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Mar 5, 2004, 12:00 AM
 
Why can't you do what you want to do in the action methods of the radio buttons?
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
hayesk  (op)
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
Mar 5, 2004, 08:49 AM
 
Originally posted by Chuckit:
Why can't you do what you want to do in the action methods of the radio buttons?
Good question. Perhaps I have been thinking about this backwards. I was wanting to retrieve the values of the radio buttons and altering my print data based on that. Sometimes I get stuck in one line of thinking. Thanks.

Although, what I would really like to do is create the print view *after* the user clicks print (or preview), since the radio buttons affect the amount of data being printed. Using the above method, I would have to create the view, user clicks one of my radio buttons, and then I have to remove some data and recalculate page numbers, etc.. It seems inefficient - especially if I add more options to the accessory panel; it will be altering data and recalculating several times.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:00 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2