Version 12 (modified by shai, 13 years ago) (diff)



General information

Welcome to the provisional homepage of the Open Source project FORTRAN/TK.
FORTRAN/TK is, an easy to learn, powerful cross-platform (OS/2 Warp and Windows 9x/NT) widget toolkit for the Open Watcom FORTRAN/77 compiler. Technically it's a kind of wrapper to Rexx/Tk but it does not rely on a Rexx interpreter. Although it is possible to embed FORTRAN console programs in Tcl/Tk? using pipes, FORTRAN/TK is the first real FORTRAN implementation of the Tk-toolkit from Tcl/Tk so far. However if you don't want or can't use the Open Watcom compiler or if you need support for Linux/Unix? platforms, you might want to check out Ftcl, an API for evaluating Tcl code in FORTRAN programs which can be used for creating Tk-interfaces, too.
All Rexx/Tk? functions are already usable from within FORTRAN/TK including some which are not even listed in the Rexx/Tk help. It also includes about 20 new functions, called FORTRAN/TK extensions, which are neither part of Tcl/Tk? nor Rexx/Tk? nor Open Watcom FORTRAN. They include functions for file management, file searching, basic support for dynamic DLL handling and the clipboard which are commonly needed to write sophisticated GUI applications.
FORTRAN/TK is one of the easiest and most comfortable ways to create graphical user interfaces using the FORTRAN programming language?. It even implements features that are not really supported by the Open Watcom FORTRAN compiler at all like variable length argument lists, using some very dirty assembly hacks. Don't ask...
For more information, including dependencies, examples and build instructions, please refer to the readme.txt. The presentation about FORTRAN/TK I held at the Developers Workshop 2005 in Dresden is also a good introduction, although it already contains outdated information.

FORTRAN/TK is licensed under the Open Software License v.2.1.


The history of all official FORTRAN/TK releases may be found in the history.txt.


Here are some screenshots of the included example programs.

FORTRAN/TK 0.6 Beta Calculator Screenshot (ReactOS :-) FORTRAN/TK Development Editor example (eComStation) FORTRAN/TK 0.7 Development Simple example (eComStation)


The various FORTRAN/TK releases are no real binary releases but more like source distributions. It must be compiled to a fortrantk.lib according to the build instructions. So each release is for OS/2 Warp and Windows 9x/NT. It is necessary to be able to compile FORTRAN/TK itself to compile a FORTRAN/TK program anyway. However the example programs are precompiled for both platforms and necessary runtime libraries are included so you can have a look at it first.

Applications using FORTRAN/TK

Here's a list of all bigger programs that use FORTRAN/TK as far as I know. If you wrote or know another one, please let me know.

  • Canabis, the Open Source Canasta card-game
  • As a project in my engineering course at school, I'm working on a program that's capable of capturing a photo containing several Lego robots each marked with two circles of the same color and of different size. The program can distinguish the robots and calculate their correct position, their angle compared to the photos bottom and their direction. It is planned to be possible to navigate a robot to a given position. It uses the Video for Windows subsystem to control the webcam so it doesn't run on OS/2. I'll maybe release the source code sometime if there are no copyright problems. It's anyway unlikely that someone is going to continue it at school.
  • FORTRAN/TK includes two major sample applications. One of them is a simple calculator and another one is a notepad-like text editor.

Further information

Currently there is no complete FORTRAN/TK documentation and guide but there are a number of files and homepages you should check out if you do want to write your own FORTRAN/TK programs.

FORTRAN Preprocessors

If you don't want to use the Open Watcom FORTRAN dialect, you already know the Ratfor-preprocessor or you have existing Ratfor code, you may want to give it a try with FORTRAN/TK. Here are some notes about FORTRAN/TK and Ratfor.
Currently I'm working on my own FORTRAN preprocessor adapted to the Open Watcom dialect, that's able to overcome some of the compiler's limitations - in a way more FORTRAN-like than Ratfor.


If you have questions or opinions or if you want to contribute, feel free to send me an email.

eComStation and Windows XP

Attachments (4)

Download all attachments as: .zip