ClassyTcl

  The ClassyTk WindowBuilder

Home    Documentation    Screenshots    Binary distributions    Source distribution   

Applications made with the ClassyTk builder use interface functions to create toplevels, dialogs or frames. The ClassyTk WindowBuilder is used to graphically edit the layout of, and code associated with these interfaces. New interface functions can be created in the the Builder. They can be edited in the WindowBuilder by double clicking their icon (or text). The WindowBuilder that pops up consequently consists of two windows: the work and the editing window

The work window

The work window displays a copy of the toplevel, dialog or frame being edited. This copy resembles the actual interface that will be created by the function being edited very closely, but is not functional. The interface consists of widgets arranged in a tabular grid. Frame widgets in this grid can contain other widgets, also arranged in a grid within the frame. The borders of the current grid are indicated by buttons which can be used to insert or delete rows and columns, and to select whether a row or column will be stretched when the parent is expanded. The position of widgets in the grid can be changed by dragging them to another (empty) location.

Clicking on a widget will select it. The selected window will be indicated by 8 small rectangles surounding its location in the grid. A widget does not nescesarily occupy the entire location it has available. Clicking on one of the small rectangles will change whether the widget will "stick" to that side or not. This is also indicated by the color of the rectangle on that side. If the widget sticks to two opposite sides, it will be stretched to fill the available space. Dragging out the east, south or south-east small rectangles will cause the widget to occupy more than one row or column (or both). The selected widget can also be moved with the arrow keys.

The editing window

The editing window displays a menu, many icons and a notebook. It is used to edit the attributes and bindings of the selected widget, and to add, delete, rename, copy and paste widgets in the work window. The menu short-cuts can be used in the work window.

Creating new widgets

The icons on the left of the editing widget represent the widgets that can be used. Clicking on an icon will create a new widget of the represented type in the same column as the currently selected widget. You can also create a widget by dragging one of these icons to the location on the work window where you want the widget to be created. Of course, you can also create widgets from the menus. Each new widget gets a name according to its type, but can be renamed later.

Renaming a widgets

The current name of the select widget appears in the entry widget in the top right of the editing window. This name will always start with "$window". $window stands for the window that will be created by the interface function. If you change the name, and press Enter, the widget will be renamed to the new name. The new name must also start with "$window".

Selecting the parent or children of the current widgets

The Select option menu makes this possible.

Changing the attributes of a widget

Under the tabs "Special" and "Attributes" you will find an interface to change the attributes of a widget. The "Attributes" allows editing all configurable options of the widget. The "Special" Tab can add a few additional options not directly available via configuration of the widget. It also features the most commonly changed attributes, so this Tab is mostly used for editing.

It is possible to put code in the fields for an attribute. If the value given to an option starts and ends with quotes or square brackets, it is considered code, and will be evaluated and the result is assigned to the option. For this code, the variable window is always available, and has the name of the window being created as its value. If the value for an option contains "$window", it will always be substituted by the window name, even if the value is not code.

Changing the bindings of a widget

This is under the "Bindings" tab. events can be added and deleted, and the corresponding code edited. If the code added to an event is empty, the event will be removed

Options and initialisation code

The "Code" contains a notebook with 3 tabs.
Options
The Options tab allows the specification of which options can be given to the interface function, and what their default and possible values are. It also specifies the defualt window name, which is by default the same as the function name with a dot prepended. The options are available in an array with the name opt.
Initialise
The code in this box will be executed after all widgets are created, but before the options wich contain code are configured. In it, you can eg. set variables that you use in code associated to widget options.
Finalise
The code in this box will be executed after the window is created. It can be used to initialise variables, add some further configurations, etc.

Peter De Rijk
hosted at SourceForge.net Logo