1 # vim: foldmarker=<<<,>>>
3 proc tlc::getinf {pathName args} {
4 uplevel tlc::Getinf $pathName $args
23 body tlc::Getinf::constructor {args} { #<<<1
24 eval itk_initialize $args
26 option add *$wdb*Button.width 12 widgetDefault
27 option add *$wdb*Button.highlightThickness 1
28 option add *$wdb*Button.takeFocus 1
33 $w.tools add "OK" [code $this choose 1] right
34 $w.tools add "Cancel" [code $this choose 0] right
36 blt::table $w -padx 5 -pady 5 \
38 $w.tools 2,1 -pady {8 0} -fill x
39 blt::table configure $w r2 -resize none
43 body tlc::Getinf::ask {args} { #<<<1
44 catch {eval destroy [winfo children $w.args]}
49 foreach {label varspec} $args {
53 foreach {varname type default} $varspec {break}
54 set rest [lrange $varspec 3 end]
56 upvar $varname dest_$varname
57 if {[info exists dest_$varname]} {
58 set data($varname) [set dest_$varname]
60 set data($varname) $default
63 label $w.args.$row,l -text "${label}:"
68 entry $w.args.$row,v -textvariable [scope data($varname)]
73 checkbutton $w.args.$row,v -variable [scope data($varname)]
77 label $w.args.$row,v -text $data($varname) -justify left \
78 -font [tlc::default_config get boldfont]
83 tlc::vartextbox $w.args.$row,v \
84 -textvariable [scope data($varname)]
88 button $w.args.$row,v -textvariable [scope data($varname)] \
89 -command [lindex $rest 0]
94 tlc::mycombobox $w.args.$row,v \
95 -textvariable [scope data($varname)] \
96 -choices [lindex $rest 0]
100 puts stderr "Unknown type: ($type)"
105 $w.args.$row,l $row,1 -anchor ne \
106 $w.args.$row,v $row,2 -anchor nw
107 blt::table configure $w.args c1 -resize none
116 foreach {label varspec} $args {
119 foreach {varname type} $varspec {break}
120 set dest_$varname $data($varname)