source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/vrippack-0.31/lib/linux/tk8.4/demos/labelframe.tcl @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 2.0 KB
Line 
1# labelframe.tcl --
2#
3# This demonstration script creates a toplevel window containing
4# several labelframe widgets.
5#
6# RCS: @(#) $Id: labelframe.tcl,v 1.2 2001/10/30 11:21:50 dkf Exp $
7
8if {![info exists widgetDemo]} {
9    error "This script should be run from the \"widget\" demo."
10}
11
12set w .labelframe
13catch {destroy $w}
14toplevel $w
15wm title $w "Labelframe Demonstration"
16wm iconname $w "labelframe"
17positionWindow $w
18
19# Some information
20
21label $w.msg -font $font -wraplength 4i -justify left -text "Labelframes are\
22        used to group related widgets together.  The label may be either \
23        plain text or another widget."
24pack $w.msg -side top
25
26# The bottom buttons
27
28frame $w.buttons
29pack $w.buttons -side bottom -fill x -pady 2m
30button $w.buttons.dismiss -text Dismiss -command "destroy $w" -width 15
31button $w.buttons.code -text "See Code" -command "showCode $w" -width 15
32pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
33
34# Demo area
35
36frame $w.f
37pack $w.f -side bottom -fill both -expand 1
38set w $w.f
39
40# A group of radiobuttons in a labelframe
41
42labelframe $w.f -text "Value" -padx 2 -pady 2
43grid $w.f -row 0 -column 0 -pady 2m -padx 2m
44
45foreach value {1 2 3 4} {
46    radiobutton $w.f.b$value -text "This is value $value" \
47            -variable lfdummy -value $value
48    pack $w.f.b$value -side top -fill x -pady 2
49}
50
51
52# Using a label window to control a group of options.
53
54proc lfEnableButtons {w} {
55    foreach child [winfo children $w] {
56        if {$child == "$w.cb"} continue
57        if {$::lfdummy2} {
58            $child configure -state normal
59        } else {
60            $child configure -state disabled
61        }
62    }
63}
64
65labelframe $w.f2 -pady 2 -padx 2
66checkbutton $w.f2.cb -text "Use this option." -variable lfdummy2 \
67        -command "lfEnableButtons $w.f2" -padx 0
68$w.f2 configure -labelwidget $w.f2.cb
69grid $w.f2 -row 0 -column 1 -pady 2m -padx 2m
70
71set t 0
72foreach str {Option1 Option2 Option3} {
73    checkbutton $w.f2.b$t -text $str
74    pack $w.f2.b$t -side top -fill x -pady 2
75    incr t
76}
77lfEnableButtons $w.f2
78
79
80grid columnconfigure $w {0 1} -weight 1
Note: See TracBrowser for help on using the repository browser.