hwtk::labelframe - Container widget with optional label
A labelframe widget is a container used to group other widgets together. It has an optional label, which may be a plain text string or another widget.
hwtk::labelframe - pathName ?option value? ...
-borderwidth, borderWidth, BorderWidth
-clientdata, clientData, ClientData
-helpcommand, helpcommand, Command
-underline, underline, Underline
Command-Line Name: -labelanchor
Database Name: labelAnchor
Database Class: LabelAnchor
Specifies where to place the label. Allowed values are (clock-wise from the top upper left corner): nw, n, ne, en, e, es, se, s, sw, ws, w and wn. The default value is theme-dependent.
Command-Line Name: -labelwidget
Database Name: labelWidget
Database Class: LabelWidget
The name of a widget to use for the label. If set, overrides the -text option. The -labelwidget must be a child of the labelframe widget or one of the labelframe**a??s ancestors, and must belong to the same top- level widget as the **labelframe.
Command-Line Name: -padding
Database Name: padding
Database Class: Pad
Additional padding to include inside the border.
Command-Line Name: -relief
Database Name: relief
Database Class: Relief
One of the standard Tk border styles: flat, groove, raised, ridge, solid, or sunken. Defaults to flat.
labelframe supports the standard configure, cget, identify, instate, and state commands.
# hwtk::labelframe
hwtk::dialog .dlg
set w [.dlg recess]
# A group of radiobuttons in a labelframe
hwtk::labelframe $w.f -text "Value";
pack $w.f -side left;
foreach value {1 2 3 4} {
hwtk::radiobutton $w.f.b$value -text "This is value $value" -variable lfdummy -value $value
pack $w.f.b$value -side top -fill x -pady 2
}
hwtk::labelframe $w.f2
hwtk::checkbutton $w.cb -text "Use this option." -variable lfdummy2
$w.f2 configure -labelwidget $w.cb
pack $w.f2 -side left -padx 4 -anchor nw
set t 0
foreach str {Option1 Option2 Option3} {
hwtk::checkbutton $w.f2.b$t -text $str
pack $w.f2.b$t -side top -fill x -pady 2
incr t
}
.dlg post;