Using grid within a Tile labelframe



Hi,

I am having some trouble understanding the way grid
works withing a labelframe in Tcl/Tk 8.5a4.

A sample program would be:

set extFrame [ttk::labelframe .extFrame -labelanchor nw \
-labelwidget [ttk::label .lb -text Greet]]

set button1 [checkbutton $extFrame.b1 -text Hello -variable hello]
set button2 [checkbutton $extFrame.b2 -text goodbye -variable goodbye]

if {$::tcl_version>=8.5} {
# grid anchor $extFrame c
}

grid $extFrame -padx 10 -pady 10 -ipadx 5
grid $button1 -sticky w
grid $button2 -sticky w

The buttons are in the left down corner, uncomenting the grid
anchor command, they are centered horizontaly, but they touch
the upper line of the labelframe.

Is they way it is meant to be?

I was expecting them to be centered in both axes, and while I
can made them centered doing:

grid $button1 -sticky w -pady {10 0}

it feels like a kludge.

Thanks,
Andres


.



Relevant Pages

  • Re: Nested grids?
    ... frame which should have a labelframe and other stuff in there. ... Widgets have parents. ... Then you create two labels and put them onto (via grid) the root window. ... through for pack and place. ...
    (comp.lang.tcl)
  • Re: Nested grids?
    ... doesn't show the labelframe. ... you don't "put a grid" anywhere. ... You can use grid with any widget as a parent. ... label .lbl1 -text "1" ...
    (comp.lang.tcl)
  • Re: Widgets dont appear after grouping and layout -- why?
    ... one for each side of the panedwindow. ... Only the right-side labelframe ... grid columnconfigure $groups\ ... # Elements labelframe: ...
    (comp.lang.tcl)
  • Re: Nested grids?
    ... frame which should have a labelframe and other stuff in there. ... why doesn't it have a widget name/ ... You created .lfr, but you never put it onto anything. ... Then you create two labels and put them onto (via grid) the root window. ...
    (comp.lang.tcl)
  • Re: Using grid within a Tile labelframe
    ... works withing a labelframe in Tcl/Tk 8.5a4. ... A sample program would be: ... The buttons are in the left down corner, uncomenting the grid ... [grid anchor]) doesn't always account for internal padding in the ...
    (comp.lang.tcl)