Archives / Search ›

Got Notebook working on Jaguar tonight. There are a few minor issues with the GUI, but for day-to-day use, it looks good. If you're interested in trying it out, read on.

As the readme mentions, Notebook 0.9 is written to work with Tcl/Tk 8.3.4, TclLib 1.3, and BWidgets 1.4.1. If you're not using Windows, the readme doesn't offer much help on obtaining them. The Tcl'ers Wiki is helpful, but the pertinent information is scattered among several pages, none of which are helpfully titled “how to install Tcl/Tk on Mac OS X”.

There are at least two functional versions of Tcl/Tk on Mac OS X. The first is a straight Unix port, which uses Unix packaging conventions and X11 for Tk. Running Notebook with this configuration is pretty straightforward, if you have already installed an X server and Tcl/Tk. I installed XDarwin and Tcl/Tk 8.3.4 from Fink (fink install tcltk). Once TclLib and BWidgets are present (below), wish notebook.tcl starts Notebook. The instructions in README.txt describe how to edit notebook.tcl so it's directly executable if you'd prefer.

The more native version of Tcl/Tk on OS X, developed primarily by Jim Ingham and Ian Reid of Apple, is still experimental. It's built as a couple of Mac OS X frameworks, Tk.framework and Tcl.framework, and includes a packaged Carbon application named Wish Shell which works approximately like the wish tool. The native Aqua/Carbon Tk is very fast, but not entirely finished. This Wiki page contains a list of the bugs you can expect to find in the Aqua implementation of Tk.

It's possible to build Tcl/Tk 8.4a4 for Mac OS X/Carbon from CVS with the included Project Builder project, but I gave up after it broke on the spaces in my hard drive's name, and went looking for a binary version. Vince Darley's Alphatk distribution contains easily installable copies of Tcl.framework, Tk.framework, and Wish Shell.app. Download the Alphatk for OS X disk image here, then move the frameworks to /Library/Frameworks and put Wish Shell somewhere you can find it (perhaps /Applications).

TclLib and BWidget are pure Tcl library extensions; while they don't require compilation, they do need to be installed in the proper places. Tcl has the concept of a script library directory, in which it'll automatically search for installed packages. For the Unix port, this is /path/to/lib/tcl8.3; the OS X port uses /path/to/Frameworks/Tcl.framework/Resources/Scripts. When you're finished, you should have directories named tcllib1.3 and bwidget1.4.1 in this directory.

There are three different methods of installing TclLib that I could see, but only one of installing BWidget. Here's what I did, after unpacking both tarballs.

% cd tcllib-1.3
% ./install.sh /Library/Frameworks/Tcl.framework/Resources/Scripts
Installing tcllib 1.3 to /Library/Frameworks/Tcl.framework/Resources/Scripts
[This installs in the wrong place, .../Scripts/lib.  We will move it back later.]
% cd ../BWidget-1.4.1
% ln -s ../tcllib-1.3/config
% aclocal && autoconf
% ./configure --prefix=/Library/Frameworks/Tcl.framework/Resources/Scripts
checking for a BSD-compatible install... /usr/local/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
% make install
[...]
% cd /Library/Frameworks/Tcl.framework/Resources/Scripts
% ls lib
bwidget1.4.1/  tcllib1.3/
% mv lib/* . 
% rmdir lib

This method also deposits documentation in .../Scripts/doc, and does a few other things which are probably wrong, but it works well enough for my purposes.

Finally, launch Wish Shell, choose Source from the File menu, and select notebook.tcl. It should display approximately as shown above.

Comments are closed.