www.delorie.com/gnu/docs/smalltalk/gst_20.html   search  
 
Buy GNU books!


GNU Smalltalk User's Guide

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.7.1 Blox

Blox is a GUI building block tool kit. It is an abstraction on top of the a platform's native GUI toolkit that is common across all platforms. Writing to the Blox interface means your GUI based application will be portable to any platform where Blox is supported.

The Blox classes, which reside in the BLOX namespace and are fully documented in section `BLOX' in the GNU Smalltalk Library Reference, act as wrappers around other toolkits, which constitute the required portability layer; currently the only one supported is Tcl/Tk but alternative versions of Blox, for example based on Gtk+ and GNOME, will be considered. Instead of having to rewrite widgets and support for each platform, Blox simply asks the other toolkit to do so (currently, it hands valid Tcl code to a standard Tcl 8.0 environment); the abstraction from the operating system being used is then extracted out of GNU Smalltalk.

Together with the toolkit, the `blox' directory contains a browsing system that will allow the programmer to view the source code for existing classes, to modify existing classes and methods, to get detailed information about the classes and methods, and to evaluate code within the browser. In addition, some simple debugging tools are provided. An Inspector window allows the programmer to graphically inspect and modify the representation of an object and, based on Steve Byrne's original Blox-based browser, a walkback inspector was designed which will display a backtrace when the program encounters an error. Finally, the Transcript global object is redirected to print to the transcript window instead of printing to stdout.

This browser evolved from a Motif-based version developed around 1993 written by Brad Diller (bdiller@docent.com). Because of legal concerns about possible copyright infringement because his initial implementation used parts of ParcPlace's Model-View-Controller (MVC) message interface, he and Richard Stallman devised a new window update scheme which is more flexible and powerful than MVC's dependency mechanism, and allowed him to purge all the MVC elements from the implementation.

Four years later I--Paolo Bonzini--further improved the code to employ a better class design (for example, Brad used Dictionaries for classes still to be fleshed out) and be aesthetically more appealing (taking advantage of the new parser and Blox text widget, I added syntax highlighting to the code browsers).

To start the browser you can simply type:

 
    gst -qK blox/Run.st

This will load any requested packages, then, if all goes well, a worksheet window with a menu named Smalltalk will appear in the top-left corner of the screen. You might want to file-in `blox/Run.st' from your `.stinit' file (see section Startup sequence) or to run it automatically through ObjectMemory (see section 2.1 Memory accessing methods).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003