local variables and fileevent script
- From: Simon Bachmann <ssiimmoonnbbaacchhmmaannnn@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Jan 2006 15:13:28 +0100
I'm developping an application that makes use of the fileevent command to keep the GUI alive during long calculations (creating/modifing large images).
What I'm looking for is a way to "pass" the value of local variables to the script fileevent will execute once the channel gets readable/wirtable. By this time, of course, the local variables probably no longer exist, or they have other values. (besides the fact you can't access them, since the script is executed in global scope.)
proc example {fd} {
set local_var "Hello" _____
| How to make the value of
fileevent $fd readable { | local_var available in
script... <-____| the fileevent script ?
}
}Both solutions I could think of don't really statisfy me: global variables (don't they say to avoid them whenever possible?) or enclose the script in "" instead of {} (you have to make a heavy use of quoting to get the script behave as you want.)
.
- Follow-Ups:
- Re: local variables and fileevent script
- From: Rolf Schroedter
- Re: local variables and fileevent script
- Prev by Date: Re: Best alternative to bgexec?
- Next by Date: Re: OT: Obfuscate or not?
- Previous by thread: widgets within TitleFrame
- Next by thread: Re: local variables and fileevent script
- Index(es):
Relevant Pages
|