WJG (09/12/08) The relentless hack to provide Tcl bindings to the Gtk core widget set moves steadily forward! Here's a screengrab of the latest offering, the gnocl::sourceView widget. This is a supersized version of the standard GtkTextView in as much as it already has lots of added extras such as undo/redo, line numbering, line cursor and the ability to display format programming languages. Don't you just love Tcl when things can be done so instantly!

#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
package require Gnocl
package require GnoclSourceView
set sourceView [gnocl::sourceView \
-showLineNumbers 1 \
-highlightCurrentLine 1 \
-insertSpace 0 \
-showLineMarks 1 \
-rightMargin 25 \
-showRightMargin 1 \
-tabWidth 4 \
-baseColor #FF0000 \
-baseFont "Mono 10" \
-onButtonPress {puts "buttonPress! %b"} \
-onButtonRelease {puts "buttonRelease %b"} \
-onKeyPress {puts "keyPress %k"} \
-onKeyRelease {puts "keyRelease %k"} \
-onUndo {puts "Undo %w"} \
-onRedo {puts "Redo %w"} ]
gnocl::window -title "SourceView" -child $sourceView
gnoc::mainLoop