I try to add two buttons to the console window for convenience and to play around with it. The problem is: The first button just triggers an "exit". This works fine. The second button triggers "LogPuts", which should write all "puts" to a file additionally. It is a toggle button. And this one gives me an "invalid command name LogPuts"
The code itself works, the procedure LogPuts is written before the button creation. Here an example:
proc LogPuts { } { ;#.... do s.th. }
console eval {
place [button .console.bExit -text "Exit" -command "exit"] -relx 0.93 -rely 0.0 -
width 62 -height 25
place [button .console.bLog -text "LogPuts" -command "LogPuts"] ] -relx 0.93 -rely
0.06 - width 62 -height 25
}
I even tried to play with uplevel 0 when invoking the button-press to get the procedure noticed on the "toplevel", but since unexperienced with it, the outcome was expected; it did not help :)
Has anyone an idea how to solve this problem? How can I invoke the Button Code in the Console Level?