Programming with Tcl/Tk

Course

Inhouse

Price on request

Description

  • Type

    Course

  • Methodology

    Inhouse

  • Duration

    5 Days

The early parts of the course use simple exercises to familiarise the attendee with the material that has been covered, and to stimulate exploration of the possibilities of Tcl. Towards the end of the course a number of project oriented exercises are introduced to demonstrate the full potential of Tcl/TK. Developing Tcl scripts to perform system admin tasks. Exploring. Suitable for: Attendees are expected to have some computer programming background, and confidence in working in a Unix environment. Typically, the need to know Tcl/TK will be an adjunct to some other engineering or programming task. Most attendees attending the Tcl/TK course have a requirement to develop test automation scripts.

Questions & Answers

Add your question

Our advisors and other users will be able to reply to you

Who would you like to address this question to?

Fill in your details to get a reply

We will only publish your name and question

Reviews

Course programme

Overview
This course provides a comprehensive introduction to Tcl and the TK extensions to Tcl. It is suitable both for novice and experienced programmers who wish to use Tcl for automating repetitive tasks, application testing , application prototyping , rapidly developing graphical user interfaces for non-window programs.
The course covers both console based applications that use pure Tcl (and are interpreted using tclsh) ,and applications that use the Tk windowing extensions to Tcl and are interpreted using Wish. The building blocks and syntax of Tcl are covered fully (especially substitutions and grouping).
Extensions to Tcl are discussed, and a survey of useful extensions is provided, including Expect. The uses of Expect for automating interactive tasks such as transferring files via FTP and sending mail via mail are covered.

Key Skills
  • Writing and maintaining Tcl scripts
  • Developing scripts to initiate and control multiple processes
  • Implementing effective graphical user interfaces for Unix tools and utilities
  • Developing Unix system administration tools with graphical user interfaces
  • Implementing and understanding test scripts
  • Automating interactive applications such as FTP and mail

Practical Work
The early parts of the course use simple exercises to familiarise the attendee with the material that has been covered, and to stimulate exploration of the possibilities of Tcl. Towards the end of the course a number of project oriented exercises are introduced to demonstrate the full potential of Tcl/TK.
  • Developing Tcl scripts to perform system admin tasks
  • Exploring the uses of Tcl for system testing purposes by writing Tcl scripts to test out a simulated alarm system
  • Implement a graphical, form based front end to an online help system using TK
  • Write an Expect program to automate downloading of files over the internet via FTP overnight, and print out a report of successful and unsuccessful download attempts.
  • Develop a simple terminal emulator using Expect and the TK text widget
  • Devise an automated mail handling and filtering facility using Expect.

Course Contents
The background to Tcl/TK
  • The Tcl interpreters tclsh and Wish
  • An overview of available Tcl libraries and their uses
  • Tcl as an extensible scripting language
The basics of Tcl
  • commands
  • variables
  • scalars
  • associative arrays
  • substitution
  • grouping
  • if -- elseif -- else
  • switch
  • for loops and foreach loops
  • while loops
  • continue and break
  • lists and list manipulation
  • strings and string manipulation
  • an introduction to regular expressions and pattern matching
  • procedures and functions
  • launching applications from Tcl
Tk and widgets
  • what widgets are and how they work
  • creating and configuring widgets
  • widget hierarchies and types
  • toplevel widgets
  • frames
  • buttons
  • checkboxes and radiobuttons
  • label widgets
  • message and text widgets
  • listboxes
  • scrollbars
  • canvases
  • widget properties (colour, size, position)
  • associating widgets, events and commands
  • geometry managers
  • grids
Expect
  • patterns and actions
  • debugging patterns and controlling I/O
  • handling processes and users
  • expect - internals and command line options
  • send, spawn, signal and interact commands
  • using expect to handle multiple concurrent processes
  • running Expect in the background

Programming with Tcl/Tk

Price on request