|
From: Kevin W. <sw...@wo...> - 2004-10-25 00:20:48
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Pat Thoyts wrote:
|
| The progress bar widget has a get and a set subcommand which take the
| value to set the progress bar too. For instance, if we define the
| range of the widget as 0 - 100, then a [$progressbar set 50] will
| cause the bar to fill half the widget.
| eg:
| pack [tprogress .p -from 0 -to 100]
| .p set 50
|
| If you want to read the value, either [.p get] or [.p cget -value]
| will do it.
| So to cycle:
| proc every {ms body} {after $ms [info level 0]; eval $body}
| proc Update {w interval} {
| set v [expr {[$w get] + $interval}]
| if {$v > [$w cget -to]} {
| set v [$w cget -from]
| }
| $w set $v
| }
| every 250 {Update .p 10}
|
Pat,
You were kind enough last month to provide the sample code above to help
me get started with the Tile progress bar widget. I've tweaked the code
for use in the application I'm working on and it works
beautifully...except that I don't know how to back out of the loop I've
set up. It cycles for an indefinite period of time (which is exactly
what I wanted it to do :-)). Destroying the window containing the
progress bar doesn't help because the every and update procedures are
still chugging in memory, and I get error messages that loop at the same
frequency of the code. And I've looked for a way to kill the procedure
itself, by using after cancel, but nothing seems to work. Can you give
me any direction in *closing* the loop? Thank you so much.
Regards,
Kevin
- --
Kevin Walzer, PhD
WordTech Software--Open Source Applications and Packages for OS X
http://www.wordtech-software.com
http://www.smallbizmac.com
http://www.kevin-walzer.com
mailto:sw...@wo...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBfEbLJmdQs+6YVcoRAgEyAJ9CzyyK5rNcQn37HLrTJsqB1Y3XRwCfZOr+
0Vbupnk89bmiX9qEyEOZt7U=
=SdTK
-----END PGP SIGNATURE-----
|