logo

Noumena Corporation


Whitmore Lake
Michigan

Tcl is a speciality at Noumena.

Clif Flynt wrote the book on Tcl. He also helps organize the annual Tcl/Tk User's Conference, speaks at Open Source events and has taught Tcl/Tk around the world.

Tcl/Tk: A Developer's Guide - 3'd Edition
Third edition describes TclOO, Tcl Modules, threading and more
The third edition of Tcl/Tk for Real Programmers was published in spring of 2012.

It includes over 150 new pages covering new features in 8.6. There are chapters describing TclOO, Tcl Modules, Sockets, Threading and much more.

The target for this book is an experience programmer who needs to pick up a new language quickly. Tcl's primary features are covered in depth. New features and tricks of the trade are described in detail. Finally, there is an entire chapter devoted to optimization and debugging techniques.

Tcl/Tk Programming Tools
Tcl tools and tips to make you more productive.
Noumena Corporation has developed and maintains a number of Tcl scripts that make our life a little easier.

These include:

  • Small and useful Tcl scripts.

  • Bare-Bones TCP/IP client and server: Just add application

  • A pure Tcl html display widget

  • Building megawidgets in namespaces (pre Tcl8.6)

  • An enhanced version of D. Richard Hipp's tree megawidget.

  • A sample Tcl extension to demonstrate techniques.

  • Data-Driven GUI generator.

  • A text widget that supports wordprocessor controls and saves formatted text in RTF format
    more

Papers
Tcl tools and tips to make you more productive.
Noumena has delivered papers at a number of conferences and has written several whitepapers on Tcl and Open Source related topics.

Here are some papers

Tcl Tools
Small and useful Tcl scripts.
These tcl packages include:
  • parseargs - the command line argument parsing procedure used in many Noumena packages.
  • listx - more list handling procedures.
  • stringx - more string handling procedures.

More Info

Get tcltools.zip: (5841 bytes)

MegaWidget skeleton
Building megawidgets in namespaces (pre Tcl8.6)
The Mega Dummy is a dummy megawidget skeleton that simplifies building custom megawidgets. This is the latest version of the script described in Tcl/Tk for Real Programmers and Tcl/Tk: A Developer's Guide.

NOTE: This is a namespace based solution to making megawidgets.

Tcl/Tk: A Developer's Guide, 2'nd edition discusses TclOO and describes better object oriented techniques for creating megaWidgets.

This package includes a script to convert the dummy skeleton into a new package using a number of regular expression substitutions.

More Info

Get megaDummy.zip: (14322 bytes)

formattedText: Extended Text Widget
A text widget that supports wordprocessor controls and saves formatted text in RTF format
The formatted Text widget supports a GUI for selecting font, slant, weight, foreground and background.

It also supports saving a document as an XML doc, a "native" form document, or in RTF.

Import is supported for XML and native format. The RTF document can be loaded into MS Word, LibreOffice, OpenOffice, and other word processing tools.

Get formattedText-20181004.zip: (24988 bytes)

dlopen extension
Load shared libraries within Tcl scripts
The dlopen extension loads a shared library that does not contain a xx_Init entry point on Posix or Windows platforms.

This allows loading extensions that require other shared libraries to be resident before they can resolve their symbol tables.

This extension is a single .c file which should compile cleanly on Posix or Windows systems. It's been tested on Linux, and MS-Windows 95 with VC++ 5.0.

Get dlopen.zip: (2138 bytes)

Feb 2005:
Fortran/Tcl 3: Wrapping a FORTRAN/Tcl with TOBE
Wrapping applications with TOBE
In order to distribute a FORTRAN/Tcl application, either the client needs to have Tcl installed, or you need to wrap the application into a single executable. D. Richard Hipp's TOBE wrapping solution is best for this application.
Discusses
Wrapping Applications Editing the TOBE Makefile Tcl_Init
Tcl_EvalFile Tcl_FindExecutable Zip
more
Aug 2004:
Fortran/Tcl 2: Making a better GUI for FORTRAN Applications
Digression: Fortran/Tcl 2: Making a better GUI for FORTRAN Applications
Demonstrates the flexibility of writing a GUI as script appended to a compiled application. A GUI script is easy to modify and extend without affecting the core application. You can even change a challenge/response application to a real-time application.
Discusses:
labelframe image scale

Read the article (PDF) (49307 bytes)

Get the code: (29652 bytes)

Apr 2004:
Firewall Validation 8: Mobile Agents in Tcl
Firewall Validation 8: Mobile Agents in Tcl
A client application can send a Tcl script an Agent server for remote evaluation. This article describes creating an Agent based client/server pair, using SSL to ensure that only scripts from trusted agents are evaluated, and evaluating scripts in a Safe sandbox.
Discusses:
safe::interpCreate safe::interpAddToAccessPath
safe::interpDelete info complete

Read the article (PDF) (80756 bytes)

Get the code: (13809 bytes)
more

Oct 2003:
Firewall Validation 6: Client/Server sockets
Firewall Validation 6: Client/Server sockets
Tcl's Socket interface is clean and simple. This makes it an ideal choice for developing client/server applications.
Discusses:
socket (client) socket (server) flush
fconfigure fileevent vwait

Read the article (PDF) (247792 bytes)

Get the code: (1601 bytes)
more

Jun 2003:
Firewall Validation 4: Capturing and Analyzing Packets with an AxTcl
Firewall Validation 4: Capturing and Analyzing Packets with an AxTcl
How to use AxTcl on the Spirent AX-4000 to capture packets and display statistics and packet contents.
Discusses:
ax interface analyzer
enet

Read the article
more
Feb 2003:
Firewall Validation 2: Testing the packet generator with AX4000
Firewall Validation 2: Testing the packet generator with AX4000
Describes using the Spirent Ax4000 to measure line usage and confirm that the dnet extension can saturate a 100-B-T line.
Discusses:
ax interface analyzer
enet

Read the article (PDF) (93194 bytes)

Get the code: (93131 bytes)

June 2002:
Advanced Tk Techniques 3: popup Help
Popup Help messages
Adding popup help messages to buttons, labels, etc.
Discusses:
bind after toplevel
winfo wm message

Read the article (PDF) (74746 bytes)

Get the code: (1404 bytes)

April 2002:
Advanced Tk Techniques 1
Resizeable displays
Describes using pack, place and grid to make resizeable GUI applications.
Discusses:
pack place grid

Read the article (PDF) (237363 bytes)

Get the code: (1213 bytes)

December 2001:
Extraction information from tcpdump
Display text from tcpdump output
Describes extracting the text from the hex output of tcpdump.
Discusses:
tcpdump format join
split format string regexp

Read the article (PDF) (189719 bytes)

Get the code: (1957 bytes)
more

July 2001:
Using the binary command to examine telnet configuration messages
Binary data and sockets
Describes using the binary command to display the IAC interaction during the start of a telnet session.
Discusses:
  • binary
  • fconfigure
  • read
  • split
  • regsub

Read the article (PDF) (204442 bytes)

Get the code: (4546 bytes)

April 2001:
Client/Server System Monitor with History
Client/Server System Monitor with history
Shows how to save the last N hours worth of events, and display them in a scrolling canvas.

Read the article (PDF) (234008 bytes)

Get the code: (3170 bytes)

December 2000:
Introduction to TCP/IP Client-Server in Tcl
Client/Server system monitor
Introduces the socket command, and shows how to build a client-server pair that will monitor disk space, and report when the space gets low.

Read the article (PDF) (239300 bytes)

Get the code: (951 bytes)

August 2000:
Better graphs, sales volumes, Associative arrays
More things to do with the BLT graph widget
This article expands on the previous graphing program and shows how to use bar charts with graphs, use multiple axes, and display custom labels on the tics.

Along with that, it discusses using the associative array to organize the data.

Read the article (PDF) (602435 bytes)

Get the code: (2184 bytes)

April 2000:
Building HTTP Robots
fancy regular expressions
Extending the stock robot
This article explains some of Tcl's new regular expression options, and extends the robot to get all the available data.

Read the article (PDF) (49121 bytes)

Get the code: (517 bytes)

October 1999:
Extending the HTML viewer
Extending the HTML viewer
This article shows how to extend the Tcl HTML package to read images, and bounce to hyperlinks.

The example code is an improved htmlviewer that will let you look at images or load links at your discretion.

Read the article (PDF) (60800 bytes)

Get the code: (20612 bytes)

June 1999:
File IO, Strings, Text Widget
Catching unowned IRC Robots
This article described a simple script that will confirm that all the tasks running on a system are owned by legitimate, logged in, users. We used this script to track and kill IRC Robots that crackers left on the college network where Clif Flynt was teaching at the time.

Read the article (PDF) (52265 bytes)

Get the code: (848 bytes)

Postcard Creator
Generate postcards
Sometimes you need to send a formal comment to a bunch of folks.

But how?

Emails get spam-boxed and letters won't get opened for fear of anthrax.

Postcards are safe and don't go into spam boxes.

This application will print four double-sided postcards on a sheet of paper, with addresses on one side and message on the back.

More Info

Postcard Creator
Generate postcards
This is a collection of useful applications, games and other things that I've used and may be of use to others.

These include:

  • Control: a Tk front-end to the BottleRocket X-10 Controller

  • Generate postcards

Tclsh Spot
Articles written for ;login: magazine
Clif Flynt wrote articles about Tcl for ;login: magazine between 1999 and 2005.

The example code from these articles is available here.

The The Tclsh Spot articles are available on line for Usenix members. There are links to the older articles that are available online for the general public.

A tree display widget
An enhanced version of D. Richard Hipp's tree megawidget.
This widget is an enhancement of D. Richard Hipp's tree megawidget.

The modifications include:

  • Namespace and package support
  • Faster tree building (particularly for large trees)
  • Options to control how the widget behaves
    -windowsMode
    Can open a directory with a double click (not single) on text, icon, or [+]
    -highlight
    Highlights lines blue when the cursor is above them.
    more
Sample Tcl Extension
A sample Tcl extension to demonstrate techniques.
This sample Tcl Extension is a dummy extension that provides examples of passing data and status between the Tcl interpreter and the C functions.

The code is commented and described in detail in my books.

Get sampleExtension.zip: (24884 bytes)

Tcl html widget
A pure Tcl html display widget
htmllib.tcl. This script was written by Steve Uhler while he was with Sun Labs. It's a pure Tcl html display package that is used in TclTutor, htmlview.tcl and TclPoint.

This version supports the Tcl/Tk 8.0 and newer Font conventions and simple tables.

Get htmllib-rel_0_3_4.zip: (112222 bytes)

EditTable: Automatically generated database display/editing GUI
Data-Driven GUI generator.
These utilities use the SQL Schema to define a GUI for displaying and editing entries in a table.

It will generate a "good enough" GUI from just the Schema, or you can use SQL comments to fine tune the GUI,

Using the package is described in the paper that was presented at the US Tcl Conference.

Get editTable20170530.zip: (152877 bytes)

Client-Server Skeleton
Bare-Bones TCP/IP client and server: Just add application
Client-Server Skeleton. These two scripts provide a simple outline for writing Tcl/Tk based client/server applications. The standard socket controls are here (opening a socket, waiting for input, etc), and you just add the code to process the data.

Note: The client/server skeleton uses parseArgs from the Tools package.

Get cli-serv-Rel_1_1.zip: (6634 bytes)

Oct 2004:
Fortran/Tcl 4: Generating a graphic display with the canvas widget
FORTRAN/Tcl: Data Visualization with a Tk Canvas
FORTRAN applications can generate lots of numbers. The Tk canvas provides a good tool for visualizing that information.
Discusses
canvas scrollbar canvas bind
canvas xview/yview create line create polygon

Read the article (PDF) (55501 bytes)

Get the code: (29605 bytes)
more

Jun 2004:
Fortran/Tcl 1: Using Tcl with FORTRAN
Digression: Fortran/Tcl 1: Using Tcl with FORTRAN
Adding a Tcl intepreter to a FORTRAN program is an easy way to extend your FORTRAN programs to support graphics, networks, configuration files, etc. This article describes how to link the Tcl interpreter to a FORTRAN application and use a Tk GUI for input and output.
Discusses
ftcl_start labelframe entry
button label vwait
more
Feb 2004:
Firewall Validation 7: Secure Sockets, TLS and creating a simple Certificate Authority
Firewall Validation 7: Secure Sockets, TLS and creating a simple Certificate Authority
For secure applications, you need secure communications. The TLS extension allows Tcl sockets to use SSL for communications. This article describes setting up private certificates for secure private communications.
Discusses
tls::socket tls::handshake
interp create interpName alias

Read the article (PDF) (61017 bytes)

Get the code: (13364 bytes)
more

Aug 2003:
Firewall Validation 5: Monitoring log files with Expect
Firewall Validation 5: Monitoring log files with Expect
Tcl's Expect extension is ideal for automated scanning log files. This article describes watching the log files to confirm that expected events occur.
Discusses
spawn expect exp_send proc

Read the article (PDF) (12919 bytes)

Get the code: (824 bytes)

Apr 2003:
Firewall Validation 3: Generating packets and validating the code
Firewall Validation 3: Object Style programming in Tcl
Describes object style programming using the namespace command in the context of building broadband packets, and then describes validating the new procedures.
Discusses
namespace variable tcltest

Read the article

Read the article (PDF) (152409 bytes)

Get the code: (22108 bytes)
more

Oct 2002:
Firewall Validation 1: Building extensions with SWIG
Firewall Validation 1: Building extensions with SWIG
Describes how to convert an existing library into a Tcl extension using swig. Builds an extension using the dnet library for sending and receiving ethernet packets.
Discusses
SWIG extensions

Read the article (PDF) (76266 bytes)

Get the code: (93131 bytes)

May 2002:
Advanced Tk Techniques 2: Automatic Scrollbars
Scrollable Displays
Describes how to build applications with scrollbars that appear and vanish as required, and how to simulate a scrollable frame.
Discusses
frame canvas
grid scrollbar

Read the article (PDF) (97351 bytes)

Get the code: (2644 bytes)

Feb 2002:
Getting and comparing HTML pages
A simple html interaction tester
An example application that takes reformatted output from tcpdump and turns it into a Tcl script that can be used to replay an interaction.
Discusses
http vwait
clock format read

Read the article (PDF) (173456 bytes)

Get the code: (5685 bytes)
more

Sep 2001:
A Telnet Client
A simple Telnet Client
Implements a simple telnet client that can interact with a server, maintain its internal state, and respond to various commands the server can send. Demonstrates some features of the Tcl namespace.

Read the article (PDF) (199826 bytes)

Get the code: (2670 bytes)

June 2001:
Displaying utmp data with the binary command
Examining binary data
Describes using the binary command to dump the information in the utmp file.

Read the article (PDF) (13417 bytes)

Get the code: (1036 bytes)

February 2001:
More IP-style Client/Server techniques
Expanded Client/Server system monitor with BLT barchart
This article expanded on the previous article by:
  • Using a single server with multiple ports for different information.
  • Displaying client data with a barchart.
  • Handling exception conditions with catch.
  • Checking for valid clients.

Read the article (PDF) (265718 bytes)

Get the code: (2583 bytes)

October 2000:
Multiple lines on a chart, menubuttons, more associative array techniques
Comparing multiple data sets with the BLT Graph widget
This article described how to:
  • use BLT with multiple lines of data
  • bind actions to the lines
  • generate postscript images of a graph
  • use a tk menubutton

It expands on the discussion from the previous three articles.

Read the article (PDF) (106466 bytes)

Get the code: (1565 bytes)

June 2000:
File I/O, the BLT Graph widget
Analyzing data - Introducing BLT
Now that we can get the stock data, lets start saving the results, and put together something simple to look for trends.

This article shows how to use the Tcl File commands to save the results, and how to use the BLT extension graph widget to display them later.

Read the article (PDF) (73448 bytes)

Get the code: (1111 bytes)

December 1999:
Building HTTP Robots
strings, regular expressions
Introducing the stock robot
This is the first of several articles that show how to build a simple stock quote retrieving robot.

This article creates a simple robot that will return the current price.

Read the article (PDF) (108691 bytes)

Get the code: (340 bytes)

August 1999:
Using the HTML viewer
An HTML viewer for MIME mail readers
I like to read mail with a plain old text type mail viewer. But metamail doesn't have built in support for HTML mail. This viewer will handle simple HTML messages (but not most advertising mail).

Read the article (PDF) (59072 bytes)

Get the code: (17075 bytes)

April 1999:
Intro to Tcl/tk
img Tcl/Tk Introduction: A GUI Calculator
The first Tclsh Spot article introduced the basic commands and showed how to create a GUI calculator (with 8 commands and about 30 lines of code.)

Read the article (PDF) (78887 bytes)

Get the code: (790 bytes)

X-10 Home Automation GUI
Control: a Tk front-end to the BottleRocket X-10 Controller
An image based GUI for home automation.

This tool makes it eash to create customized control panels for the BottleRocket X-10 Controller.

More Info

Get control-Rel_1_0.zip: (4111 bytes)