Gnocl implements GTK+ and Gnome bindings for the programming language Tcl
with emphasize on ease of use, following the example of Tk.
It provides commands to build quickly GTK+ / Gnome compliant
applications including the canvas widget, GConf and the Gnome applet.
Gnocl is split in several libraries, which can be loaded on demand.
The newest version of Gnocl can be found at
http://www.dr-baum.net/gnocl/.
Please send feedback, suggestions, bug reports to
<peter@dr-baum.net>
.
The mandatory "Hello World" example looks like this:
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
package require Gnocl
set but [gnocl::button -text "Hello World" -onClicked {puts "Hello World"}]
gnocl::window -title "Hello World Example" -child $but
gnocl::mainLoop
|

A more complete example which produces a GUI like the following,
is explained in more detail.

package require Gnocl
set menu [gnocl::menu]
$menu add [gnocl::menuItem -text "%#New" -tooltip "Make new" \
-onClicked {puts "That's new"}]
$menu add [gnocl::menuSeparator]
$menu add [gnocl::menuItem -text "%#Quit" -onClicked exit \
-tooltip "Quit program"]
set file [gnocl::menuItem -text "%__File" -submenu $menu]
set menu [gnocl::menu]
$menu add [gnocl::menuItem -text "%__About" \
-tooltip "Show about dialog" \
-onClicked {puts "Mini example (c) 2001 P.G. Baum"}]
set help [gnocl::menuItem -text "%__Help" -submenu $menu]
set toolBar [gnocl::toolBar -style both]
$toolBar add item -text "%#Quit" -tooltip "Tooltip Quit" \
-onClicked exit
$toolBar add space
$toolBar add item -text "%#New" -tooltip "Tooltip new" \
-onClicked {puts "That's new"}
set box [gnocl::box -orientation vertical -borderWidth 0 -spacing 0]
set win [gnocl::window -child $box -title "Test Application"]
$box add [gnocl::menuBar -children [list $file $help]]
$box add $toolBar
$box add [gnocl::label -text \
{%<<span foreground="blue" size="large">Hello</span>\
<span foreground="red" size="large">World</span>}] -expand 1
$box add [gnocl::statusBar]
gnocl::mainLoop
|