Poet2.2 Manual Prototype Object Extension for Tcl

The Poet Package & Requirements

Poet is divided into three tiers.  Tier 1 extends the Tcl language with the command Object and a few other handy objects, including Thing, which provides persistence.   When Poet loads it can be limited to just Tier 1, in which case Tk is not required.   Some of the methods of Object are implemented in C, this is refered to as Tier 0 and can be loaded by itself, though it won't do much.   The API to Object is described here.  This, like all of the API documentation, is automatically generated by scanning the comments in the Poet source code.

Tier 2 extends Tk and Ttk with megawidget support and a few extra widgets.  Wrappers around each of the existing Tk, Ttk, and BWidget widgets are autogenerated by the assimilator (this is done once, in advance, not when Poet is loaded).  The autogenerated files are stored in Tier 2a, while Tier 2b consists of the files that define the assimilated widgets and load the Tier 2a code, so all the autogenerated objects appear under Tier 2b in the index to the left.  Some of the Tier 2b files include additional, hand-written methods that extend the wrapped widget.   All of the known attributes of the wrapped Tk and BWidget widgets are made into slots on the corresponding Poet objects, so they can participate in the constraint network.

The top of the Tier 2 object hierarchy is ProtoWidget, the prototype for all widgets, which is documented here.   By default, tiers 0, 1, and 2 are loaded when Poet is loaded.  Note, however, that most objects are dynamically loaded when they are invoked, only a few objects in each tier are marked to be preloaded when the tier is loaded.

Tier 3 provides Poetics, the Poet Integrated Construction Set.  When Poetics is loaded, each widget will have a right-click menu that allows the user to edit the widget or any of the widgets that contain it (all the way up to the toplevel widget).  The menu also has items to open an object browser and a code browser.

Tier Provides Requires
1 Basic objects, persistence, constraints Tcl8.4 or 8.5
2 Wrapped widgets, megawidgets Tk8.4 or 8.5, BWidget1.8
3 Poetics Tktable2.9, Tkhtml3, patched BWidget