Syntax

  • Tcl has a simple structure.
  • Each line starts out with a command followed by a number of arguments
  • Each commmand is implemented as a C function.
    widget pathname [option1 value1 [option2 value2 ...]]


  • Syntax
    Means
  • #Text
  • comment
  • command arg1 arg2
  • Execute the command, with the given arguments.
  • "Text in quotes"
  • Pass the text between the quotes as one argument, performing command and variable substitution.
  • {Text in braces}
  • Pass the text between the quotes as one arguemnt, defer substitution until later.
  • $variable
  • Substitute the value of the given variable.
  • [command arg]
  • Executge the command, then substitute the return value in place of the entire command between the square brackets.
  • command arg1 \
  • Extend command over one line.
    arg2  





    Tk/Tkl

  • Brief Introduction
  • First Example
  • Second Example
  • History
  • Key Features
  • Why Tk/Tcl?
  • When Should You Use Tcl?
  • Basic Syntax
  • Widgets & Such
  • Running Tcl Programs
  • Odds & Ends