|
From: Joe E. <jen...@fl...> - 2006-03-27 21:53:30
|
Vince Darley wrote:
> This simple script creates two buttons (one tk, one Tile), on TkAqua:
>
> package require tile
> toplevel .tt -bg red
> button .tt.b -text "Cancel" -padx 0 -pady 0 -bd 0 -highlightthickness 0
> ttk::button .tt.b2 -text "Cancel" -padding {0 1 0 1}
> place .tt.b -x 50 -y 20 -width 63 -height 21
> place .tt.b2 -x 50 -y 50 -width 63 -height 21
>
> Despite both being the same size, the tile one leaves so much space to
> the left of the 'C' that there isn't enough room to fit in the whole
> text, and so the 'l' isn't drawn.
>
> Any suggestions on how to fix this?
Depends on what you're really trying to do -- would a "small"
or "mini" size Aqua button work (if it were available in Tile?)
In general, if you force a widget to be smaller than it wants to be,
it's not going to look right.
In this case: the button element internal padding is derived by calling
GetThemeButtonContentBounds(), so that (hopefully!) the button text
doesn't extend outside the alloted area.
You could try specifying a large negative padding, to allow the
button text to extend outside the margins.
> I also note that both buttons have a couple of pixels spare above the
> button, which is surprising since the configuration options in this
> artificial example aim to get rid of it!
This is probably coming from the focus ring.
Aqua "full-size" buttons are 20 pixels high, and the ttk::button
also includes space for the focus ring (by experimentation, an
extra two pixels on all sides).
--Joe English
jen...@fl...
|