Showing posts from March, 2014

New Megawidget Boilerplate

Haven't posted much to the blog recently. This isn't because things are quiet on the Tcl/Gnocl side, I've just been doing more applications coding. Today's posting is a result of this. I already use a bunch of gnocl megawidgets but there always seems to be slight differences between each module. I thought that I'd settle this once and for all by creatings a boiler plate module which can then be adapted to suit. Because I shift between the gnocl C sources and Tcl, I thought it wise to follow a similar design approach in both.

Individual procedures handle the construction, configuration and command handling for each widget instance and error checking is implemented too.

# widget.tcl
# Boilerplate object builder package for gnocl derive megawidgets.
# Based upon approach used in Gnocl source code.
# William J Giddings, 28-Mar-14.
# Substitute keyword _widget_ for unique object type identifier.
# !/bin/sh
# the…