![]() Tcl is designed to have commands added to the language. Second, Tcl interprets commands once and saves the byte-compiled code, so slow is not always that slow. Modern computers can do an awful lot in 1/20 of a second. Nevertheless, if soon is 0.00005 seconds or 0.05 seconds, you will be hard pressed to tell. When you push a button something should happen soon. Speed is not always very important in a GUI. A program that is compiled will run faster than one that is interpreted. One of the major criticisms of interpreted languages is speed. The button action now changes to display a new window when pressed. Into the command window, type the following commands, one line at a time:īutton $w -text "Hello World" -command A window for commands and a window for graphics will then be displayed. ![]() In Windows, you might have to find the WISH82.EXE file in a folder like c:\GSAS\TCL832\BIN and then click on it. Suppose you have Tcl/Tk loaded on your computer (and there is a fair chance you do), you can start the command interpreter by typing "wish" in Unix. Perhaps the easiest way to give you a feel for Tcl/Tk is to give you an example of a very simple program. Lest I forget to mention: Tcl/Tk and, for that matter, all my software is available on the Internet, free, and with source code. I'll also give an overview of some of the projects that I have tackled using Tcl/Tk. In this article, I will tell you a little bit about Tcl/Tk. Thus, the exact same source code is used on all platforms. Those sections of the code check what operating system is being used and react accordingly. However, to take one project (EXPGUI) as an example, in ✳7,000 lines of code only a few hundred lines are either Windows or Unix-specific. True, I do need to tweak my Tcl/Tk code a bit to get around some of the limitations of Windows. The former is no longer true, but from what I can see, there are still many platform-dependency issues Java. At the time when I was looking, platform-independent GUI tools for Java were not available and Sun and Microsoft were fighting for control of the turf. Java gets lots of press, too, and can do many of the same things. ![]() For my purposes, I'll consider them a single language, Tcl/Tk. Also, while Tk is available for Perl and Python, it was originally created by the author of Tcl, John Ousterhout, so it comes as no surprise that Tk works best with Tcl. ![]() What I can say is that Tcl was very easy for me to learn and it turns out to be very powerful, so I have never needed anything else. Some people feel that other scripting languages, notably Perl and Python might be better choices than Tcl. The solution that eventually adopted is a scripting language, called Tcl, and a GUI tool, called Tk. I want to encourage other people to collaborate on software - if they must purchase something to do this, they probably won't. I want the same software to work on my desktop SGI, my Linux home computer and my coworker's Windows box (3) cheap. Learning new skills is important, but time is always scarce (2) cross platform. ![]() Tel: 30 Fax: 30 Ībout a decade ago, I started looking for a good way to create graphical user interfaces (GUI) for the FORTRAN programs that I was using on a regular basis and for those I was writing. Old wine in new bottles: creating graphical user interfaces for FORTRAN programs via Tcl/TkĬrystallography Team, NIST Center for Neutron Research, Stop 8562, National Institute of Standards and Technology, Gaithersburg, MD 20899-8562, USA. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |