console eval

console eval script

Evaluates script in the interpreter that is executing the code to manage the Tk console window.


AMG: [console eval] can be used to customize the Tk console window. Here are some console customizations present in my as-yet-unreleased development version of Wibble:

console eval {
    # Remove the "Hide Console" menu item.
    .menubar.file delete 1

    # Set the window title.
    wm title . "Wibble Web Server"

    # Exit the application when the console is closed.
    wm protocol . WM_DELETE_WINDOW exit
}

# Add a menu item to reload the Wibble script.
console eval [list .menubar.file insert 1 command -label "Reload Wibble"\
    -underline 0 -command [list consoleinterp eval [list source $argv0]]]