FJL

Contents
Music

Software
TWO
Hdocu

Mail

Inhalt
Musik

Software
TWO
Hdocu

Impressum
Mail
Home > Software > TWO > Doc

FJL: TWO Library

TWO = Tcl/tk Widget add-On

The TWO Library is a collection of TCL-only compund widgets, also known as "megawidgets", and a bunch of accompaining packages. A compound widget is built using normal Tk widgets and can be used like an ordinary Tk widget (wherever possible). It does not try to hide its internal structure to commands like "winfo" or "bind".

Some general notes on using, naming conventions and internal structure are available.

For new versions have a look at the TWO homepage: http://www.fjl.de/two/. Comments, bug reports and especially patches and code submissions are always welcome!

Table of Contents

  1. Screenshots
  2. Widgets
  3. Additional Commands
  4. Demo Applications
  5. Using this library


1. Screenshots

Click on the thumbnails to show large image:

Screenshot 1 Screenshot 2 The first screenshot shows a toplevel window with a toolbar. There are several buttons, checkbuttons and a combobox in it. Please note that the toolbar can be torn off.

The main area is a MDI with 5 slave widgets, 2 of them are minimized. All slave windows are editor widgets, the active one is split into two parts (both showing the same editable text, separated by a splitter).

The style of all megawidgets (where suitable) is set to windows, but the application is run on UNIX.

The second screenshot shows a help window. It also has ist own toolbar. The main area contains the widget (sorry, text is in German language). There are some embedded images, and some links.


2. Widgets

two_autosb.n
An automatic scrollbar: it is only visible when it is really needed, i.e. it automatically disappears whenever there is nothing to be scrolled.
two_button.n
Slightly improved Tk button (interprets &)
two_checkbutton.n
Slightly improved Tk checkbutton (interprets &)
two_combobox.n
Like the windows combobox. Combines an entry widget and a drop-down list (menu) in one widget. The drop-down list is exposed by clicking the button on the right side of the the entry widget; the drop-down list can be resized interactively.
two_historybox.n
A convenience wrapper around the two_combobox widget which provides an entry with a command history.
two_editor.n
An ASCII text editor; extends two_text (also part of this library). It provides methods to open/save files into the widget and can be split into two parts (using the splitter) which show different parts of the same file.
two_html.n
A simple HTML 2.0 widget used to display, eg., online help. Almost all of HTML 2.0 is recognized, but FORMS currently are not supported. The widget knows hyperlinks and a page history.
twohtmlc.tcl.1
"Compile" HTML files (and images) to TCL, i.e., create code which pre-loads those pages into the two_html.n widget or creates an array.
two_label.n
Slightly improved Tk label (interprets &)
two_mb.n
A tk_messageBox which sets the parent widget to a reasonable value.
two_mdi.n
An implementation of the MDI widget known from Windows. An MDI is like a windowmanager within another window: you can open an arbitrary number of slave windows, move, resize, maximize and minimize them, and sure enough close them. There are window menus and a root menu.
two_splitter.n
Slave widgets (panes) are arranged in rows or columns. The size of each pane can be controlled by draging the resize handler between each pane.
two_shell.n
A fake shell widget used to run interactive applications. It shows a fake prompt and fake command string.
two_toolbar.n
A toolbar may consist of buttons, checkbuttons, radiobuttons, and combobox, it can be torn off and the buttons have a flat appearance.
two_mb.n
Thin wrapper around tk_messageBox with default [two_ct] as default value for parent widget.
two_menu.n
Tk menu command with better support for setting accelerator keys, underlinig and tooltips.
two_text.n
Tk text widget with some different keyboard bindings (no emacs bindings, better CTRL-left/right handling etc.) and a (simple) auto indent mode. It has unlimited undo/redo capability and can be coupled with a slave xtext.


3. Additional Commands

two_array.n
Load and save TCL arrays to files.
two_bugmail.n
A replacements for the standard Tk bgerror handler: the user can send bug reports to the maintianer of the software (eror message, call stack, and user's own comments).
two_center.n
Center a toplevel widget on the screen.
two_ct.n
Get the current toplevel widget (with one of it's children having the focus).
two_define.n
Conditinal execution of code.
two_else.n
Conditinal execution of code.
two_endif.n
Conditinal execution of code.
two_ifdef.n
Conditinal execution of code.
two_ifndef.n
Conditinal execution of code.
two_icons.n
This library proviedes several icons wich an be used in a toolbar.
two_invoke.n
Invoke a Tk button with visual feedback (flashing the button as if it were pressed with the mouse).
two_keyrec.n
Record and playback of key events.
two_kshPwd.n
Replacement for tcl pwd and cd commands which emulates the behaviour of ksh concerning symbolic links to directories.
two_noExportImport.n
Disable importing and exporting the selection and clipboard. Only useful under some rather rare circumstances.
two_opt.n
Several option settings for making Tk applications more beautiful on several UNIX systems (written for CDE on HP/UX) and some workarounds.
twopre.pl.1 or twopre.tcl.1
"Precompile" a tcl file. It does inlining of TCL source and image create commands .
Comments can be removed and the additional tclpre set/if/else/endif commands are processed.
two_pre.n
Emulates the tclpre.pl filter, which in turn emulates the C preprocessor.
two_showCenter.n
Show a toplevel (might be iconified, withdrawn or simply hidden). If no previous position has been selected, center it on the screen.
two_tooltip.n
Show little help messages if the mouse pointer rests a minimum amount of time over a widget.
two_undef.n
Conditinal execution of code.
two_util.n
Cotains some of the above utility procedures.


4. Demo Applications

This distribution comes with several little demo applications. Their main purpose is to show how to use the widgets. Some of them might be useful as building blocks for larger applications.


5. Using this Library

There are several ways to use this library:

  1. If you don't want to install the files, then you can simply use the tcl source command for each file that you need. Please note that some files require some others, so there are restrictions on their order.
  2. An alternative is to only source the tclpre.tcl and libw.tcl files.
  3. Use the command lappend auto_path /path/to/lib to make the package require commands work without installing the library
  4. Install the library and use package require

TWO is available under the same license as Tcl/Tk: See the file license.terms.

[FJL] [Music] [Software] [Impressum] [Mail]
Last Modified: 2005-09-10 (webmaster@fjl.de)