Monday, December 10, 2007

Debugging tcl/tk program (window platform)

I used to write tcl/tk program on Linux XandrOS platform , past few days, a lot of time has been spent on writing program on windows (tcl\tk is multi-platform anyway). My laptop screen is slowly failing, few vertical lines appeared one by one. Hence, I used the desktop monitor as an alternative. Unfortunately the Linux environment cannot be displayed by my monitor at home. Last choice : windows!

There are different feels programming in Windows and Linux.

In term of program debugging , using Linux is easier , the puts instruction can always be used to display the parameter of interest, or to check for the logic. puts "some string" will display the string at Linux console. However in windows (from my very little experience) , it cannot be done. It can be done actually .. by invoking the wish(wish is the interpreter for tk) and using source command to evaluate a tcl program. However the wish interpreter will be terminated as the application developed are closed. This never happen in Linux.
Another technique , without using interpreter interactive mode, is to run program by just clicking at the .tcl file. for debugging purpose , the tk_messageBox command can be used to pop up certain message instead of using puts command.

One good thing about windows is, the GUI for my application have better looks.

No comments: