]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/PrintFramework.py
apparently the check for too small rect is needed not only with wxNB_MULTILINE (see...
[wxWidgets.git] / wxPython / demo / PrintFramework.py
index 0bf389a6aeb47562cf23803d4d1fe917ce92e0cc..86dcdd5eca3d0fcdfb01255a34035cc721d1fb5e 100644 (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 when the dialog is 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()