The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Поиск:  Каталог документации

Next Previous Contents

3. What is Tcl/Tk

3.1 What is Tcl?

Tcl is the acronym for "Tool Command Language" (it is pronounced "tickle"). Tcl is actually divided into two things: a language and a library.

Tcl is a simple textual programming language, intended for issuing commands to interactive programs such as text editors, debuggers and shells. It has a simple syntax and it is also programmable.

Tcl users can write command procedures to provide more powerful commands than those given in the built-in set.

Second, Tcl is a library package embeddable in applications. The Tcl library consists of a parser for the Tcl language, routines to implement the Tcl built -in commands, and procedures which allow each application to extend Tcl with addit ional commands specific to that application. The application program generates Tcl commands and passes them to the Tcl parser for execution.

Commands may be generated by reading characters from an input source, or by associating command strings with elements of the application's user interfa ce, such as menu entries, buttons, and other widgets. When the Tcl library receive s commands it parses them into component fields and executes built-in commands directly.

For commands implemented by the application, Tcl calls back to the application to execute the commands. In many cases commands will make recursive invocation s of the Tcl interpreter by passing in additional strings to execute (in fact procedures and conditional-looping commands all work in this way). An applicat ion program can obtain many advantages by using Tcl for its command language:

It is important to note that Tcl was designed thinking that the programmer should actually use two or more languages when designing large software system s. One for manipulating complex internal data structures, or where performance is important, and another, such as Tcl, for writing very small scripts that glue together the other pieces, providing hooks for the user to extend.

For the Tcl script writer, ease of learning, ease of programming and ease of gluing are more important than performance or facilities for complex data structures and algorithms.

Tcl was designed to make it easy to drop into a lower language when you come across tasks that make more sense at a lower level. In this way, the basi c core functionality can remain small and one need only bring along pieces that one particular wants or needs.

One answer to "What is Tcl?" can be found at www.NeoSoft.com/tcl /whatistcl.html .

3.2 What is Tk?

Tk (pronounced "tee-kay") is an extension to Tcl which provides the programmer with an interface to the X11 windowing system . Note that Tk has been successf ully compiled under X11 R4, X11 R5, X11 R6, as well as Sun's NeWS/X11 environments.

Many users will encounter Tcl/Tk via the "wish" command. Wish is a simple windowing shell which permits the user to write Tcl/Tk applications in a proto typing environment.

At present Tcl/Tk cannot handle Japanese, Chinese, Korean, .... language fonts.

3.3 Extensions

Since Tcl is so easy to extend, many try to share extensions, including the popular itcl, [incr Tcl], ObjectTcl, TclX, Tix , and BLT.

These extensions, of course, require an extended Tcl interpreter. Moreover, many Tcl free applications require a particular Tcl extension to run.

One of the most popular extension is called Expect. It allows you to place a friendly front-end inside most command-line based UNIX applications, such as ftp, telnet, rlogin, passwd, fsck, and so on.

A complete list of Tcl/Tk extensions can be found at URL www.scr iptics.com/resource/software/extensions/.

3.4 Supported Platforms

This section contains information about Tcl 8.0 and Tk 8.0, the most recent version of Tcl/Tk. They were originally released on August 18, 1997 and the most recent patch releases (8.0.3) were made on September 3, 1998.

When you download Tcl and Tk you get two programs, wish and tclsh, supporting script libraries, and on-line reference documentation. These programs are gene ral purpose platforms for writing applications with Tcl. Wish includes the graphic al user interface toolkit Tk. The packages are ready to use after installation.

Tcl 8.0 and Tk 8.0 run on most releases of the following operating systems:


Next Previous Contents


Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру