dabo Commit
Revision 4889
Date: 2008-12-27 09:41:07 -0800 (Sat, 27 Dec 2008)
Author: Ed
Trac: http://trac.dabodev.com/changeset/4889

Changed:
U   trunk/ide/ClassDesignerPropSheet.py

Log:
Fixed an error that only happened on Gtk, where the font metric call was 
referring to a released window, causing a segfault.


Diff:
Modified: trunk/ide/ClassDesignerPropSheet.py
===================================================================
--- trunk/ide/ClassDesignerPropSheet.py 2008-12-27 16:08:03 UTC (rev 4888)
+++ trunk/ide/ClassDesignerPropSheet.py 2008-12-27 17:41:07 UTC (rev 4889)
@@ -685,9 +685,15 @@
                if self.Application.Platform == "Win":
                        self.setAll("FontSize", fsize-2, filt="BaseClass == 
dabo.ui.dColumn")
                # Set the row height to match
-               self.RowHeight = dabo.ui.fontMetric("M", face=c0.FontFace, 
size=c0.FontSize, 
-                               bold=c0.FontBold, italic=c0.FontItalic)[1] + 7
-
+               face = c0.FontFace
+               size = c0.FontSize
+               bold = c0.FontBold
+               italic = c0.FontItalic
+               rh  = dabo.ui.fontMetric("M", wind=self.Form, face=face, 
size=size,
+                               bold=bold, italic=italic)[1] + 7
+               if 0 < rh < 999:
+                       # Make sure that these are sane values
+                       self.RowHeight = rh
                # Reference to default classes. Don't know if this is the best 
solution...
                self.stringRendererClass = col.stringRendererClass
                self.boolRendererClass = col.boolRendererClass




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to