If I have a StaticText object (or any other, I guess) that has been set to use a certain font, is there a way to set just one attribute of that font as applied to the control, without knowing what the original font was? Specifically, I’d like to be able to highlight controls with bold text, but otherwise keep the original font attributes.
thanks,
Nat
···
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
I'm not too sure what you mean by "without knowing what the original
font was" but you could do:
font = ctrl.GetFont()
font.SetWeight(wx.FONTWEIGHT_BOLD) # or whatever it is
ctrl.SetFont(font)
···
On 4 May 2010 18:26, Nathaniel Echols <nathaniel.echols@gmail.com> wrote:
If I have a StaticText object (or any other, I guess) that has been set to
use a certain font, is there a way to set just one attribute of that font as
applied to the control, without knowing what the original font was?
Specifically, I'd like to be able to highlight controls with bold text, but
otherwise keep the original font attributes.
thanks,
Nat
--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
Yes, that looks like exactly what I wanted. Thanks!
-Nat
···
On Tue, May 4, 2010 at 10:47 AM, Steven Sproat sproaty@gmail.com wrote:
On 4 May 2010 18:26, Nathaniel Echols nathaniel.echols@gmail.com wrote:
If I have a StaticText object (or any other, I guess) that has been set to
use a certain font, is there a way to set just one attribute of that font as
applied to the control, without knowing what the original font was?
Specifically, I’d like to be able to highlight controls with bold text, but
otherwise keep the original font attributes.
I’m not too sure what you mean by "without knowing what the original
font was" but you could do:
font = ctrl.GetFont()
font.SetWeight(wx.FONTWEIGHT_BOLD) # or whatever it is
ctrl.SetFont(font)
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en