Grid, data and printing problem.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Grid, data and printing problem.

Zig Zag
Hello wxPython users,
the default content is printed correctly but how
do i print the modified content of my grid.
I don't understand how it works.

I have attached an example for whoever will help me.

Thanks your very much, this
example is for a wxPyWiki page.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

test.py (45K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Grid, data and printing problem.

Dietmar Schwertberger-2
On 6/17/2018 8:26 PM, Zig Zag wrote:
> the default content is printed correctly but how
> do i print the modified content of my grid.
> I don't understand how it works.

Your code is calling CreatePrintData right after creation of the grid.
So the inital data is stored within the PrintGrid instance.

The simplest modification is to call CreatePrintData right before printing:

     def OnPrintPreview(self, event):
         self.CreatePrintData()
         self.grdprt.Preview()

     def OnPrint(self, event):
         self.CreatePrintData()
         self.grdprt.Print()


While this simple modification works, you should create the printing
data structures only for printing and destroy them after printing again.
There is no point in storing them permanently as self.grdprt

Regards,

Dietmar


--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Grid, data and printing problem.

Zig Zag
Hello Dietmar,
I thank you for this quick and accurate answer.

Regards,
Zig zag

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.