![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.tcl archiveRe: Some newbie questions
From: Michael A. Cleverly <michael@cleverly.com>
Date: Sat Jul 30 2005 - 18:34:23 CEST
On Sat, 30 Jul 2005, it was written:
> OK, but what if my script is in a file? source the file(s) again doesn't work
You can resource your application while it is running. With a little bit
First, you'll want to save where your application is run being run from.
set ::filename [file join [pwd] [info script]]
Then later, you can:
source $::filename
to reload any changes.
You just need to take care to not recreate widgets (or other things that
if {![info exists ::filename]} then {
or you could separate widget creation from widget configuration and write:
if {![info exists ::filename]} then {
.b configure -text "Hello"
then you could change your source file and edit the above line to read:
.b configure -text "Bye"
and reload it.
Michael
|