Here's a protentially trivial problem that I have: how can I make a
button not take up any extra space height-wise?
The following case...
pack [label .l -text hello -relief raised] -side left
pack [button .b -text hello] -side left
...results in a button nearly twice as high as the label (on Windows at
least). Why the difference between buttons and other lables? The -height
option only takes integer # of lines. I guess I could make my own
buttons using lables, or use "place" rather than pack or grid, but this
sounds rather tedious... Is there an option to control this somewhere
that I'm missing?
Also, it doesn't actually seem quite consistent with the Win interface -
I just compared with the buttons in the Windows Find dialogue and they
are somewhat narrower...
Lahcene Si Ameur <lah...@bagh.com> wrote in message
> I would like to reduce to the maximun the height of buttons but TK
> always preserve a defaults height. Please someone can help me to resolve
> this problem ?
The height is based on the contents plus some borders and such. Are you
saying that, regardless of the contents (say, a label in a really big
you want the size to be constant, or are you saying the size is OK
for the extra padding added by tk?
If the latter, check out the -highlightthickness, -padx, -pady
and -borderwidth options. If the former, you can create a frame of the
preferred size and pack the button into that frame after turning
propagation off. To wit:
frame .foo -width 20 -height 20
pack propagate .foo off
button .b1 -text "Foo" -width 10 -height 2
pack .b1 -in .foo