Make the copy ctor for the wxPrint*Data classes avaialble from

Python. This is so we can ensure we get a copy of the data objects
when needed instead of just a reference to a data object within
another that may get deleted unexpectedly.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-06-08 00:04:54 +00:00
parent 31f8e937b8
commit 356f3c650c
2 changed files with 13 additions and 3 deletions

View File

@@ -130,7 +130,12 @@ class TestPrintPanel(wx.Panel):
printerDialog = wx.PrintDialog(self, data)
printerDialog.GetPrintDialogData().SetSetupDialog(True)
printerDialog.ShowModal();
self.printData = printerDialog.GetPrintDialogData().GetPrintData()
# this makes a copy of the wx.PrintData instead of just saving
# a reference to the one inside the printDialogData that will
# be destroyed
self.printData = wx.PrintData( printerDialog.GetPrintDialogData().GetPrintData() )
printerDialog.Destroy()
@@ -163,7 +168,7 @@ class TestPrintPanel(wx.Panel):
if not printer.Print(self.frame, printout, True):
wx.MessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wx.OK)
else:
self.printData = printer.GetPrintDialogData().GetPrintData()
self.printData = wx.PrintData( printer.GetPrintDialogData().GetPrintData() )
printout.Destroy()