Presentation is loading. Please wait.

Presentation is loading. Please wait.

An Overview of Tcl/Tk Programming. Tcl/Tk Tcl (Tool Command Language) is used by over half a million developers worldwide and has become a critical component.

Similar presentations


Presentation on theme: "An Overview of Tcl/Tk Programming. Tcl/Tk Tcl (Tool Command Language) is used by over half a million developers worldwide and has become a critical component."— Presentation transcript:

1 An Overview of Tcl/Tk Programming

2 Tcl/Tk Tcl (Tool Command Language) is used by over half a million developers worldwide and has become a critical component in thousands of corporations. It has a simple and programmable syntax and can be either used as a standalone application or embedded in application programs. Best of all, Tcl is open source so it's completely free. Tk (Toolkit) is a graphical user interface toolkit that makes it possible to create powerful GUIs incredibly quickly. It proved so popular that it now ships with all distributions of Tcl.

3 History of Tcl/Tk Tcl/Tk is actually two products originally developed at the University of California Berkeley, now at Sun by John Ousterhout: the Tool Command Language and the Tool Kit. They are a versatile scripting language and a graphical interface development tool, respectively. Tcl/Tk can be used for GUI (Graphical User Interface) development with the powerful Tk. Tcl/Tk runs as a plugin from web browsers made by Netscape and Microsoft, so it can be used instead of JavaScript and VBScript. It is a CGI language and can be used in servers. Tcl/Tk is also extremely extendable and is valuable to C/C++ programmers who want to learn a high-level scripting language for their user interfaces or for integrating pieces of a large system.

4 Tcl Praise http://www.tcl.tk/customers " We use a Tcl interpreter in each of the hundreds of back-end host processes that provide services to Digital City's 4.5 million monthly visitors. Tcl greatly simplifies the task of configuring these services and managing them remotely. " Jim Davidson, Chief Technology Officer, AOL's Digital City. " Tcl is the best scripting language for our mission-critical testing environment, bringing us several advantages. Tcl is easy to use, is embeddable and extensible, and has allowed us to automate our testing tasks to a much higher degree than we otherwise could. " Jay Yang, manager, Automated Test Solutions at Cisco. " Before we began using Tcl, we found that our current development methods and tools for system management were unable to keep up with the pace of change. With Tcl, we find that we can now respond to changes very quickly. " Marc Rossi, member of the GAS development team at NationsBank.

5 Recommended Tcl/Tk References Tcl Developer Exchange: http://www.tcl.tk/ http://www.tcl.tk/doc/http://www.tcl.tk/doc/ (online documentation) http://www.tcl.tk/doc/ http://www.tcl.tk/community/features/ For a great introduction (CD included): Graphical Applications with Tcl & Tk Eric Foster Johnson For more advanced users: Effective Tcl/Tk Programming Mark Harrison and Michael McLennen

6 Tcl Syntax Command arg1 arg2 arg3 = execute the command with the given arguments “Text in quotes” = pass text in quotes as one arg; perform command and variable substitution {Text in braces} = pass text in braces as one arg; defer command and variable substitution $variable or ${variable} = substitute the value of the given variable [command arg] = execute command; substitute value for command between square brackets Command arg1 \ arg2 = extend command over one line command 1; command 2 = two commands on one line

7 Some Tk Widgets widget name arguments = basic Tk syntax buttoncalls tcl code when pushed checkbuttonon/off (toggle) button entrytext-entry widget frameframes widgets inside a box labeldisplays text message listboxscrolled list radiobuttonon/off button set; only one on scaleanalog value from min to max texttext-entry widget BWidget library provides a nice professional looking set of Tcl/Tk widgets and is located on tyr in /usr/local/BWidget. Type /usr/local/BWidget/demo/demo.tcl on tyr.

8 Some Tk Widget Options -backgroundbackground color -commandexecutes script/proc -foregroundforeground color -heightsets height normally in pixels -imageimage to display in widget -statenormal, disabled or active -textsets text to display -textvariableget text to display from here -widthsets width normally in pixels

9 Tcl/Tk Examples All in: /home/mitchell/mitchell.linux/tcltkExamples book/chap1/hello.tcl book/chap2/for1.tcl, foreach1.tcl, arrayset.tcl book/chap3/check1.tcl, check2.tcl, scale1.tcl, textvar.tcl, frame1.tcl, frame2.tcl, rgbscale.tcl book/chap5/password.tcl, dataform.tcl


Download ppt "An Overview of Tcl/Tk Programming. Tcl/Tk Tcl (Tool Command Language) is used by over half a million developers worldwide and has become a critical component."

Similar presentations


Ads by Google