With the STK object system, every Tk graphical object used in a program such as a menu, a label or a button is represented as an object in the Scheme core. All the defined STK classes build a hierarchy which is briefly described here. Firstly, all the classes shared a unique ancestor: the <Tk-object> class. Instances of this class contain informations which are necessary to establish a communication between the Scheme and Tk worlds. Objects of this class have two main slots named Id and parent. The Id slot contains a string, normally generated by the system, which correspond to a (unique) variable name in the Tk world. The parent slot contains a reference to the object which (graphically) includes the current object. Normally, end users will not have to use direct instances of the <Tk-object> class2.
The next level in our class hierarchy defines a fork with two branches: the <Tk-widget> class and <Tk-canvas-item> class. Instances of the former class are classical widgets such as buttons or menus since instances of the later are objects contained in a canvas such as lines or rectangles. Tk widgets are also divided in two categories: <Tk-simple-widgets> and <Tk-composite-widgets>. Simple widgets are directly implemented as Tk objects and composite ones are built upon simple widgets (e.g. file browser, alert messages and so on). A partial view of the STK hierarchy is shown in Figure 2.