discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to print an image


From: Fred Kiefer
Subject: Re: how to print an image
Date: Sat, 12 May 2007 17:46:30 +0200
User-agent: Thunderbird 1.5.0.10 (X11/20060911)

Hi Riccardo,

not shure what is going wrogn here. Are you sure the view you want to
print is [windowController view]. This would be the easiest explaination
what may go wrong :-)

There is one obvious error in your code. You give the print operation as
the first parameter to the cal to runOperationModalForWindow:. Here a
window needs to be passed in. This mehtod will always show the print
panel, no matter what you set in the line before. I am not sure if this
is the correct behaviour in GNUstep, but the code seems to do this on
purpose.

You could use runOperation instead, if you want to have control over the
panel.

Cheers,
Fred


Riccardo wrote:
> Hi,
> 
> I want to add printing in PRICE (price.sf.net). The curretn version in
> CVS has a first attempt, which fails both on mac as on gnustep, so I
> seek help.
> 
> currently I essentially do:
> 
> - (void)printShowingPrintPanel:(BOOL)showPanels
> {
>     NSPrintOperation *op = [NSPrintOperation
> printOperationWithView:[windowController view] printInfo:[self printInfo]];
>     [op setShowPanels:showPanels];
>     [op runOperationModalForWindow:op delegate:nil didRunSelector:NULL
> contextInfo:NULL];
> }
> 
> 
> since I gather that the "view" (which in my case is just a subclass od
> NSView) will be printed. I read I have the option of including subwievs,
> but this is not my case: I print the view containing my image and
> instead I get printed the whole window it is contained in, including the
> scrollview...
> 
> I understand that in the future my view shall trat "printing" in
> drawRect slightly different than "video" to handle scaling, etc... but
>> from the Cocoa documentaiton I understood that for a rough start it 
> was not necesssary.
> 
> Any ideas? Hints, patches... everything welcome.
> 
> Thanks,
>    Riccardo
> 
> 
> 
> 
> 
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]