I use with success the wx print framework, but now I’m not like to show this
printing dialog when I make a print
" Please wait while printing ‘mytitle’ "
with something like :
“Please wait, I’m printing page x/x”

Do someone find/know a solution?
Thanks,
Pete
There are several different printing mechanisms in wxPython. What
calls are you using, exactly?
Because of print spooling, that can be confusing. The application,
for example, has no idea when the print job actually hits a
printer. Your application can certainly display which page it’s
currently generating, but that only means it’s going into the print
queue.
···
Pete Yan wrote:
I use with success the wx print
framework, but now I’m not like to show this
printing
dialog when I make a print
" Please wait while printing ‘mytitle’ "
with
something like :
"Please
wait, I’m printing page x/x"
-- Tim Roberts, Providenza & Boekelheide, Inc.
timr@probo.com
Thanks for the reply!
Here is code :
data = wx.PageSetupDialogData()
data.SetPrintData(self.pdata)
data.SetDefaultMinMargins(True)
exec print job
data = wx.PrintDialogData(self.pdata)
printer = wx.Printer(data)
text = self.tc.GetValue()
img = self.img
printout = ImagePrintout(img, “title”, self.pdata)
useSetupDialog = False
if not printer.Print(self, printout, useSetupDialog)
and printer.GetLastError() == wx.PRINTER_ERROR:
wx.MessageBox(
“There was a problem printing.\n”
“Perhaps your current printer is not set correctly?”,
“Printing Error”, wx.OK)
else:
data = printer.GetPrintDialogData()
self.pdata = wx.PrintData(data.GetPrintData()) # force a copy
printout.Destroy()
My application running on many computers outside, it used to be printing photos.
So I don't want the customers can see the dialog box when they printing photo.
Does it has solution to hide this dialog box?
在 2015年5月16日星期六 UTC+8上午12:40:47,Tim Roberts写道:
<details class='elided'>
<summary title='Show trimmed content'>···</summary>
> Pete Yan wrote:
> > I use with success the wx print
> > framework, but now I'm not like to show this
> >
> > printing
> > dialog when I make a print
>
>
> There are several different printing mechanisms in wxPython. What
> calls are you using, exactly?
>
>
>
>
> > " Please wait while printing 'mytitle' "
> >
> >
> >
> > with
> > something like :
> >
> >
> >
> > "Please
> > wait, I'm printing page x/x"
>
>
> Because of print spooling, that can be confusing. The application,
> for example, has no idea when the print job actually hits a
> printer. Your application can certainly display which page it's
> currently generating, but that only means it's going into the print
> queue.
> ```
> -- Tim Roberts, ti...@probo.com
> Providenza & Boekelheide, Inc.
> ```
</details>
Pete Yan wrote:
My application running on many computers outside, it used to be
printing photos.
So I don't want the customers can see the dialog box when they
printing photo.
Does it has solution to hide this dialog box?
The dialog box is created by the underlying C++ code, in
wxPrinterBase::CreateAbortWindow. If this were C++, you could derive a
new class and override it, but I don't think that works across the C++ /
Python boundary.
The wx.Printer functions are just convenience functions that wrap the
lower-level APIs. If you really need that much control, then you may
need to use the lower-level APIs yourself.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.