Button height problem

Hi list,

I just started with wxruby and I ran into something - not sure if it’s a
bug.

No matter what I set the buttons properties/options to, the height of
the button doesn’t change. Even when I set the text size to 24 pt. and
it doesn’t fit in the button any more, the button stayed the same height
and the text runs off the top and bottom.

Thanks!

Sean DeNigris

Hi Sean

DeNigris S. wrote:

I just started with wxruby and I ran into something - not sure if it’s a bug.

No matter what I set the buttons properties/options to, the height of the button doesn’t change. Even when I set the text size to 24 pt. and it doesn’t fit in the button any more, the button stayed the same height and the text runs off the top and bottom.

It’s not a bug, it’s a feature :wink: Compared to other cross-platform
toolkits, Wx puts the utmost importance on having the application look
and act exactly as would an app coded with each platform’s native
frameworks.

Following this, a text button has an appearance, font face& size and
colours determined by the platform’s UI standards and possibly the
user’s own theme settings. Wx enforces this, and you deal with the
resulting variations in size by using flexible Sizer-based layouts.

So I’d reconsider first why you want to use a different size of button
since this will break UI guidelines from Windows, Apple and GNOME. Of
course, there could well be a good reason, and if so, you could look at
using Wx::BitmapButton (possibly drawing your own Bitmap with text go
into it), or buttons within a Wx::ToolBar, or using Wx::NativeRenderer
which will allow you to draw stock GUI items like button edges in native
style at arbitrary sizes

alex

It’s not a bug, it’s a feature :wink: Compared to other cross-platform toolkits, Wx puts the utmost importance on having the application look and act exactly as would an app coded with each platform’s native frameworks.
Aha!

So I’d reconsider first why you want to use a different size of button since this will break UI guidelines from Windows, Apple and GNOME. Of course, there could well be a good reason, and if so, you could look at using Wx::BitmapButton (possibly drawing your own Bitmap with text go into it), or buttons within a Wx::ToolBar, or using Wx::NativeRenderer which will allow you to draw stock GUI items like button edges in native style at arbitrary sizes
I’ll def look into these - the motivation was to have buttons with
really big text for older people using the app.

Thank you - that answer was perfect! And so obvious now. Are these
things (like which platforms do not honor which options) written down
somewhere, or do you just learn from experience?

Sean DeNigris
[email protected]

On 08/03/2010 18:57, DeNigris S. wrote:

So I’d reconsider first why you want to use a different size of button since this will break UI guidelines from Windows, Apple and GNOME. Of course, there could well be a good reason, and if so, you could look at using Wx::BitmapButton (possibly drawing your own Bitmap with text go into it), or buttons within a Wx::ToolBar, or using Wx::NativeRenderer which will allow you to draw stock GUI items like button edges in native style at arbitrary sizes

I’ll def look into these - the motivation was to have buttons with really big text for older people using the app.

To me this is an important reason for Wx’s emphasis on native widgets. A
user who needs big text will (or should) have set that in their desktop
settings. Similarly, users with other kinds of, say, visual or mobility
impairment will have set system preferences for colour schemes, or how
mouse moves and clicks are interpreted. By using the native application
frameworks to build the GUI the user’s overall settings will be
honoured, without any extra effort on your part as a programmer. GUI
toolkits which employ lower-level calls to draw lines and text on the
screen, and handle raw input from devices might achieve good integration
at an aesthetic level (look’n’feel), but still not know how to adapt to
more specialised needs.

I should note that as of wx 2.8, extra support for assistive
technologies like was incomplete, and not available in wxRuby - but
common situations like larger text, high contrast etc should be dealt
with automatically.

Are these things (like which platforms do not honor which options) written down somewhere, or do you just learn from experience?

AFAIK there isn’t a single place this is all collated. Where there are
methods not supported at all on one platform or other, this should be
noted, and the wxWidgets wiki has a lot of notes on distinctive features
of different OS’s. Prob more useful is to have a quick look at the UI
guideline documents from Apple, Microsoft and Gnome. Search for platform

  • HIG. They’re different in style but have much good advice and thought
    on what makes usable and attractive applications.

best
alex