Subject: Re: buttons are too big! - DN [1]


Roy Terry <royterry@earthlink.net> - 29 May 1999 - comp.lang.tcl

 Let me just repeat Bryan Oakleys response to similar questions two
 weeks ago:
 Subject:
              Re: TK / problem with height of button
         Date:  Wed, 12 May 1999 16:37:45 -0600
        From:  "Bryan Oakley" <oakley@channelpoint.com>
  Organization:  ChannelPoint, Inc.
  Newsgroups:    comp.lang.tcl
References

1

 Lahcene Si Ameur <lahcene@bagh.com> wrote in message
 news:3739DB6C.74B2A783@bagh.com...
 > Hi,
 >
 >  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
 font)
 you want the size to be constant, or are you saying the size is OK
 except
 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
 geometry
 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

 Jonas Beskow wrote:
 >
 > Hello all,
 >
 > 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...
 >
 > Thanks
 > - Jonas

Last modified
1999-09-27

(195.108.246.50)

Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated