I'm trying to block any user interaction that is not done via `event generate`.
To do this I want to break the bindings when $user is not 1.
I want to pass the $user arg to the procedure `block` but I do not
know how to.
I thought this is done by -data but I get an error saying I can not
use that with the event <ButtonPress>.
```
package require Tk
button .b -text "Hello, World!"
pack .b -padx 20 -pady 20
proc block {{user 0}} {
if {$user ne 1} {
return -code break
}
return
}
bind .b <ButtonPress> {block}
bind .b <ButtonRelease> {block}
after 1000 [list event generate .b <ButtonPress> -data 1]
```
First question is: why? What are you really trying to accomplish?
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,029 |
Nodes: | 10 (0 / 10) |
Uptime: | 150:46:51 |
Calls: | 13,333 |
Calls today: | 3 |
Files: | 186,574 |
D/L today: |
3,412 files (899M bytes) |
Messages: | 3,355,804 |