[wxPython-users] change font for wx.CollapsiblePane label

Robin Dunn robin at alldunn.com
Thu Nov 1 17:11:55 PDT 2007


Patrick J. Anderson wrote:
> I was wondering if changing pane label font can be done after 
> wx.CollapsiblePane is instantiated?

Since it wraps a native widget on wxGTK then it might work there, but I 
doubt it will on the other platforms.  On the other platforms it is 
composed of several widgets and if it wasn't designed to pass the 
SetFont call to the button widget then you're out of luck.

Unless, of course, you don't mind cheating.  ;-)  You can get access to 
the button by learning about how the composite widgets are put together, 
which can easily be discovered with the widget inspection tool in the 
demo.  In this case it is as easy as

	btn = collPane.GetChildren()[0]
	btn.SetFont(...)

Keep in mind that this won't work on wxGTK since the composite widget is 
not used there.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list