The current implementation of the Fltk extension, version 0.4, is at a fairly advanced stage of development and is being released at this time to permit interested users to test the implementation and to both identify bugs and to suggest improvements. The current package is, however, stable and fairly extensive, and can be used to develop elaborate applications.
The Fltk extension is completely compatible with existing Tcl and Tk applications and any Tcl/Tk extension packages that are available or in use. Fltk widgets and commands co-exist with Tcl/Tk command sets. If desired, the Fltk command set can be consigned to a Tcl namespace so that no conflict with other packages occurs.
The Fltk widget set supports schemes for rendering widgets in different visual presentations. Currently supported schemes include the standard widget rendering scheme that has a clean consistent appearance on both Unix and Windows platforms, as well as an OpenGL based rendering scheme that can be used to create visually interesting widgets. Additional schemes permit the use of images and computed patterns as shins, as well as the native plastic scheme that is part of the FLTK library.
The use of container widgets greatly simplifies geometry management under Fltk. There is no specific geometry manager per se. Mega-widgets are assembled using containers that provide automatic geometry management of their children, automatic scrollbar management, widget resize management and notebook tabs without the need for significant support code.
The Fltk widgets can co-exist with the Tk widget set. The current version does not support mixed mega-widgets using the two packages, however, an existing Tk application can be extended using Fltk widgets. The two widget sets can interact using suitable Tcl glue code. You can, for instance, have top level windows for both widget sets on the screen at the same time, and use event handlers to support interactions between the widget sets. You can wrap a Tk top level inside an Fltk top level using an event handler to control the geometry of the Tk top level, although I personally find this to be heretical.
Because of the C++ implementation of the Fltk extension, the creation of new mega-widgets is somewhat simplified when compared to the Tk API. No knowledge of the X tool kit is required. Generally speaking, creating new widget or mega-widget involves writing 1 parameterless drawing function and implementation of some standard functions for the getting and setting of option values. Since the Fltk tool kit uses native GUI facilities on the target platforms, there is no need to maintain Windows code and X code using, for instance, #ifdef __WIN32__ expressions. This also means there is no performance loss going from X to Windows. The Fltk distribution also includes a GUI based mega-widget development tool that makes it very easy to create complex mega-widgets which can then be included in the extension package.
The Fltk extension implements several language related constructs that make the initialization of widget options convenient. An option database management interface that is portable across platforms is used to support a powerful scheme for configuring applications.
The Fltk extension supports a number of popular image formats, including BMP,PNG,JPEG and TIFF. Extension widgets can use images as wallpaper and for button faces. Image widgets can be updated from disk at rates that make it feasible to implement image animation applications for some types of technical applications. The package supports the import of image data from sensor instruments that provide rectangular arrays of intensity data.
The Fltk extension implements an enhanced event mechanism that supports user defined as well as standard window based events. The extension also provides for the binding of event handlers to Tcl variables and for the binding of Tcl variables to widget properties.
The Fltk extension implements support for multiple native languages and idioms. If desired, scripts could be written entirely in a native language, or in some mix of native languages, or in some idiom that only people in your village will understand.
| Tcl/Fltk
for Windows |
All windows environments running
the Tcl/Tk 8.4 series of releases |
| Tcl/Fltk
for 32 bit Linux |
All Environments running the
Tcl/Tk 8.4 series of releases |
| Tcl/Fltk
for 64 bit Linux |
All Linux x86_64 (IA 64) machines with Tcl/Tk 8.4 series releases |
set tcl_library
There are 2 options for using the package. You can start the wish shell and issue the command:
package require Fltk
which, if your installation is done correctly, will load the extension and install the extension command set. Under Linux, you can use the command fltkwish, which will load a modified wish shell that automatically loads the extension package.
Under Windows, the current distribution has been generated using static libraries and the MINGW cross compiler. As such, you should be able to run it without any other stuff on your machine. On my windows box I have the Tcl/Tk binary distribution for the 8.3 release, and the extension package works just fine. I have not tested a box without the Tcl/Tk installation yet. There is a fltkwish.exe file that should work out of the box. Alternatively, you can create a .wishrc file that contains the following commands:
wm withdraw .
package require Fltk
The Tcl/Tk documentation included with the Tcl/Tk distribution contains information on .wishrc files.
It is also possible to use Fltk as a Tcl extension. In order to do this, however, you must arrange for Tcl to enter its event loop once you have configured your widgets. As released, the binary packages found here do not permit this use, as Tk is automatically loaded, however you can build from source to get the required binaries. To get a Tcl only version you need to remove the call to Tk_InitStubs in the package initialization code.
Under Windows, use the same source archive, however, there is no makefile . I used the MINGW cross compiler to build the Windows distribution using the Linux makefile. If you support the Microsoft empire, I don't know what you need to do. Theoretically, the Linux Makefile should be directly useable under CYGWIN as well.
I used the public domain versions of the PNG, TIFF and JPEG libraries which are found in many places on the web. The source distribution for Windows has the static libraries I used to build the binaries.
and refer to the Tcl Fltk Extension in the subject line. I would welcome any contributions in the areas of documentation, additional widgets, additional scheme implementations and any other areas that would reduce the amount of labour I foresee for myself in getting this project to completion.
Currently, I am granting a license to use, modify, copy and re-distribute the package for private, non-commercial purposes. Commercial redistribution is prohibited without the express written permission of the author.