[wxPython-users] Centered, multiline text on a button?

Robin Dunn robin at alldunn.com
Sat Nov 17 14:25:19 PST 2007


Regan Tackett wrote:
> I need to create a button on my GUI that has two lines of text.  I would also
> like to have the text centered on the button.  How could I accomplish this and
> have it work on both Linux and Windows?
> 
> Here's my kludged example.  This will only center the text on linux, because of
> the \n.

The native buttons on XP (and also on Mac) do not support multi-line 
labels.  You'll need to do something different.  One possibility is the 
generic buttons in wx.lib.buttons, although you'll probably have to 
implement your own DrawLabel method to deal with the multiple lines.


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





More information about the wxpython-users mailing list