At times it's useful to see what values variables hold, or offer some pause point before the code goes elsewhere before causing havoc. Its possible to write output to the terminal but this can get lost in copious forms of other outputs, besides, there's no pausing the script execution either.
The following proc creates a custom dialog which displays ad message along with the point in the calling script from which it was invoked.
## simple runtime debugging feedback dialog, alternative to console based gnocl::msg
# @param msg message to display
# @returns none
#
proc xxx::msg {txt} {
set frame [info frame -1]
append msg "Message:\n\n"
append msg "$txt\n\n\n"
append msg "Called from:\n\n"
append msg "Proc:\t[lindex [info level -1] 0]\n"
append msg "File:\t[file tail [dict get $frame file]]\n"
append msg "Line:\t[dict get $frame line]\n"
gnocl::dialog \
-type info \
-text $msg \
-title [lindex [info level 0] 0] \
-setSize 0.2
}
Subscribe to:
Comments (Atom)
-
Given this module some attention today. Added some of the more package wide options to the module and created customised handler for settin...
-
Spent some time today creating some simple howto-tutorials on creating standalone Tcl/Gnocl applications using freewrap. The process is almo...
-
Linux distros have heaps of pre-installed icons ready for use. I recently needed to create a toolbar menu which needed to access a set of un...