Button has too much space around text

0 views
Skip to first unread message

Kenneth Porter

unread,
Nov 23, 2009, 5:56:01 PM11/23/09
to wx-u...@googlegroups.com
I'm porting an app from Windows to Linux (wxGTK-2.8.10) and I'm finding
that simple buttons are displaying with a huge amound of empty space
between the text and the boundary of the button. It also seems that I don't
get this extra space when I display to an Xming X server running on a
separate Windows host. I only get the extra space displaying to the native
X server on a Fedora 11 host running kdm.

Any hints on where I can look to see where this extra space is coming from?
It creates a very bloated look in the app, which is relatively cramped
already on the screen with a lot of controls.

I'm guessing that wx is querying metrics from the display to compute the
various spacings and that the metrics are not very good, but I don't know
where to start in looking for that.

Here's code that creates a typical button in a panel of nested box sizers:

wxBoxSizer* bSizer5;
bSizer5 = new wxBoxSizer( wxHORIZONTAL );

m_moveMinus = new wxButton( m_panel2, ID_MOVE_MINUS, wxT("Move -"),
wxDefaultPosition, wxDefaultSize, 0 );
m_moveMinus->SetToolTip( wxT("Move to negative setpoint") );

bSizer5->Add( m_moveMinus, 0, wxALIGN_BOTTOM|wxBOTTOM|wxLEFT|wxTOP, 5 );

Vadim Zeitlin

unread,
Nov 23, 2009, 6:14:56 PM11/23/09
to wx-u...@googlegroups.com
On Mon, 23 Nov 2009 14:56:01 -0800 Kenneth Porter <sh...@sewingwitch.com> wrote:

KP> I'm porting an app from Windows to Linux (wxGTK-2.8.10) and I'm finding
KP> that simple buttons are displaying with a huge amound of empty space
KP> between the text and the boundary of the button.

Strange, they should look like any other GTK+ buttons on your system. I
assume this isn't the case, i.e. the buttons in other Gnome programs don't
look like this (if they do, it's just a theme setting and wxGTK correctly
honours it)?

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Kenneth Porter

unread,
Nov 23, 2009, 7:14:45 PM11/23/09
to wx-u...@googlegroups.com
On Tuesday, November 24, 2009 12:14 AM +0100 Vadim Zeitlin
<va...@wxwidgets.org> wrote:

> Strange, they should look like any other GTK+ buttons on your system. I
> assume this isn't the case, i.e. the buttons in other Gnome programs don't
> look like this (if they do, it's just a theme setting and wxGTK correctly
> honours it)?

Ah, the theme might very well be the problem. I'm not real familiar with
Linux GUIs and installed the display managers and X server after initially
loading the system to run with only text consoles, so it may be missing a
lot of customization. I set the default DM to be KDE (as I was using
kdevelop as my front-end to gdb) and the menu I got was very bare-bones.


Reply all
Reply to author
Forward
0 new messages