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:
Post 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...
-
Over the past few programming sessions I've been working on producing a central point, a dashboard, around which it's possible to se...
-
The contents of a GtkTextBuffer can be saved as serialized binary file. Whilst converting such a file to ascii may be problematic if the bu...
No comments:
Post a Comment