wxButton: SetLabel resets its font

That would be:
python2.4, wx-2.5.3-gtk2-ansi

I tried your workaround, Paul but got "object has no attribute 'Font'.

I also tried:
font = self.GetFont()
self.SetLabel(val)
self.SetFont(font)

But got not results.

Should I push sysadmin to go ahead and get wxPython2.5 or is there another one coming soon?

Thanks,

···

------------------------------------

Ron Shoemaker
-------------------------------------

-----Original Message-----
From: Paul McNett [mailto:p@ulmcnett.com]
Sent: Wednesday, April 20, 2005 12:05 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] wxButton: SetLabel resets its font

Robin Dunn wrote:
> Shoemaker, Ronnie A. wrote:
>
>>
>> When I create a new wxButton it inherits the bold font
from the panel,
>> which is good. Later, when I call SetLabel to change the
the button's
>> label, the font goes back to normal weight. I tried using
SetFont to
>> reset it after calling SetLabel, even with a wx.CallAfter,
and it had
>> no effect.
>
>
> Platform and version?
>
> I think something like this was fixed recently.

Yes, you are remembering an exchange we had a few months ago
I believe.
I haven't verified that it is fixed yet, but here is the workaround I
employed in my code:

## 2/23/2005: there is a bug in wxGTK that resets the font when the
## caption changes. So this is a workaround:
font = self.Font
self.SetLabel(val)
self.Font = font

--
pkm ~ http://paulmcnett.com

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org