[Thuban-commits] r2777 - in trunk/thuban: . Thuban/UI

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sat Jun 23 02:17:17 CEST 2007


Author: bernhard
Date: 2007-06-23 02:17:16 +0200 (Sat, 23 Jun 2007)
New Revision: 2777

Modified:
   trunk/thuban/ChangeLog
   trunk/thuban/Thuban/UI/view.py
Log:
* Thuban/UI/view.py (MapCanvas.Print): Creating a PrintDialogData
object first and setting a parameter, which reenables printing 
at least on Debian Sarge with python-wxgtk2.6 2.6.3.2.0bpo1.
Bumped copyright line to include 2007.


Modified: trunk/thuban/ChangeLog
===================================================================
--- trunk/thuban/ChangeLog	2007-06-22 23:06:26 UTC (rev 2776)
+++ trunk/thuban/ChangeLog	2007-06-23 00:17:16 UTC (rev 2777)
@@ -4,6 +4,10 @@
 	import thuban without starting the application directly.
 	This makes debugging possible.
 
+	* Thuban/UI/view.py (MapCanvas.Print): Creating a PrintDialogData
+	object first and setting a parameter, which reenables printing 
+	at least on Debian Sarge with python-wxgtk2.6 2.6.3.2.0bpo1.
+	Bumped copyright line to include 2007.
 
 2007-06-23  Bernhard Reiter <bernhard at intevation.de>
 

Modified: trunk/thuban/Thuban/UI/view.py
===================================================================
--- trunk/thuban/Thuban/UI/view.py	2007-06-22 23:06:26 UTC (rev 2776)
+++ trunk/thuban/Thuban/UI/view.py	2007-06-23 00:17:16 UTC (rev 2777)
@@ -1,4 +1,4 @@
-# opyright (c) 2001, 2002, 2003, 2004 by Intevation GmbH
+# Copyright (c) 2001, 2002, 2003, 2004, 2007 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh at intevation.de>
 # Frank Koormann <frank at intevation.de>
@@ -310,14 +310,22 @@
         dlg.Destroy()
 
     def Print(self):
-        printer = wx.Printer()
+        # experiments have shown that the next three lines make
+        # printing work with python-wxgtk2.6 2.6.3.2.0bpo1 on Debian Sarge
+        # Inspired from the PrintingFramework demo of wxPython2.6
+        pdd = wx.PrintDialogData()
+        pdd.SetToPage(1)
+        printer = wx.Printer(pdd)
+        # the following line used to be enough before, unkown when it broke
+        #printer = wx.Printer()
         width, height = self.GetSizeTuple()
         selected_layer = self.selection.SelectedLayer()
         selected_shapes = self.selection.SelectedShapes()
 
         printout = MapPrintout(self, self.Map(), (0, 0, width, height),
                                selected_layer, selected_shapes)
-        printer.Print(self, printout, True)
+        if not printer.Print(self, printout, True):
+            print "printing canceled or failed" # FIXME: add real handling
         printout.Destroy()
 
     def redraw(self, *args):



More information about the Thuban-commits mailing list