OSDN Git Service

Display2 update:
[eos/hostdependX86MAC64.git] / lib / VariousButton.wish
1 #
2 #  CheckButtonsCreateWithPack
3 #               frameName 
4 #       pack              # how to pack : top bottom left right
5 #       args              # Check Buttons Variables  { varname text }
6 #
7 proc CheckButtonsCreateWithPack { frameName title pack args } {
8         set f [ frame $frameName -borderwidth 5 ]
9         label $f.title -text $title
10         pack $f.title -side $pack
11         set b 0
12         foreach item $args {
13                 set text [ lindex $item 1]
14                 set var  [ lindex $item 0]
15                 #puts "$var with $text"
16                 checkbutton $f.$b -text $text  -variable $var 
17                 pack $f.$b -side $pack
18                 incr b
19         }
20 }
21
22 #
23 # RadioButtonsCreateWithPack
24 # frameName
25 # pack    # how to pack : top botom left right
26 # varname # Variable name 
27 # args    # Radio Buttons choice
28 proc RadioButtonsCreateWithPack { frameName title pack varName args } {
29         set f [ frame $frameName -borderwidth 5 ]
30         label $f.title -text $title
31         pack $f.title -side $pack
32         set b 0
33         foreach item $args {
34                 radiobutton $f.$b -variable $varName -text $item -value $item
35                 pack $f.$b -side $pack
36                 incr b  
37         }
38 }
39
40 #
41 #
42 #
43 proc RadioButtonsCreateWithPackWithCommand { frameName title cmd pack varName args } {
44         set f [ frame $frameName -borderwidth 5 ]
45         label $f.title -text $title
46         pack $f.title -side $pack
47         set b 0
48         foreach item $args {
49                 radiobutton $f.$b -variable $varName -text $item -value $item -command $cmd
50                 pack $f.$b -side $pack
51                 incr b  
52         }
53 }
54
55 #
56 #
57 #
58 #
59 proc RadioButtonsCreate { f varname args } { 
60         set b 0
61         foreach item $args {
62                 radiobutton $f.$b -variable $varname  -text $item -value $item
63                 pack $f.$b -side left
64                 incr b
65         }
66 }
67
68 #
69 #
70 #
71 #
72 proc CheckButtonsCreate { f args } {
73         set b 0
74         foreach item $args {
75                 checkbutton $f.$b -text $item -variable $item 
76                 pack $f.$b -side left
77                 incr b
78         }
79 }
80