Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 43 |
Nodes: | 6 (0 / 6) |
Uptime: | 107:34:14 |
Calls: | 290 |
Files: | 905 |
Messages: | 76,677 |
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?