mailr12004 - /branches/bieri_gui/gui_bieri/about.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on December 28, 2010 - 21:10:
Author: bugman
Date: Tue Dec 28 21:10:28 2010
New Revision: 12004

URL: http://svn.gna.org/viewcvs/relax?rev=12004&view=rev
Log:
The font is now being restored after drawing a URL.


Modified:
    branches/bieri_gui/gui_bieri/about.py

Modified: branches/bieri_gui/gui_bieri/about.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/about.py?rev=12004&r1=12003&r2=12004&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/about.py (original)
+++ branches/bieri_gui/gui_bieri/about.py Tue Dec 28 21:10:28 2010
@@ -22,6 +22,7 @@
 
###############################################################################
 
 # Python module imports.
+from copy import deepcopy
 from numpy import uint8, zeros
 from os import sep
 from textwrap import wrap
@@ -209,6 +210,10 @@
         @type centre:           bool
         """
 
+        # Get the original font.
+        orig_font = self.dc.GetFont()
+        orig_fg = deepcopy(self.dc.GetTextForeground())
+
         # Set the font.
         font = wx.Font(pointSize=point_size, family=family, 
style=wx.FONTSTYLE_ITALIC, weight=wx.NORMAL, underline=True)
         self.dc.SetFont(font)
@@ -236,8 +241,9 @@
         # Store the URL.
         self.url_text.append(url_text)
 
-        # Restore the old font colour (black).
-        self.dc.SetTextForeground('black')
+        # Restore the original font.
+        self.dc.SetFont(orig_font)
+        self.dc.SetTextForeground(orig_fg)
 
 
     def draw_title(self, text, point_size=14, family=wx.FONTFAMILY_ROMAN):




Related Messages


Powered by MHonArc, Updated Tue Dec 28 21:20:02 2010