3 #\[sep]-----------------------------------------------------------------------------------------------------------------------------
4 proc bit_string_entry_bindings
{entry} \
6 bind $entry <Any-Key
> { }
7 # bind $entry <Key-Return> {puts return}
8 bind $entry <Key-0
> {%W insert insert
%A
}
9 bind $entry <Key-1
> {%W insert insert
%A
}
10 bind $entry <Control-u
> [bind Entry
<Control-u
>]
11 bind $entry <Control-v
> [bind Entry
<Control-v
>]
12 bind $entry <Control-d
> [bind Entry
<Control-d
>]
13 bind $entry <Delete
> [bind Entry
<Delete
>]
14 bind $entry <Backspace
> [bind Entry
<Backspace
>]
15 bind $entry <Left
> {%W icursor
[expr [%W index insert
] -1]}
16 bind $entry <Right
> {%W icursor
[expr [%W index insert
] +1]}
19 #\[sep]-----------------------------------------------------------------------------------------------------------------------------
20 proc int_entry_bindings
{entry} \
22 bit_string_entry_bindings
$entry
23 for {set i
2} {$i < 10} {incr i
} \
25 bind $entry <Key-
$i> {%W insert insert
%A
}
26 bind $entry <Key-KP_
$i> {%W insert insert
%A
}
28 bind $entry <Key-minus
> {%W insert insert
%A
}
29 bind $entry <Key-KP_Subtract
> {%W insert insert
%A
}