1 / 5

Tcl/Tk Part 2

Tcl/Tk Part 2. Overview of Basic Tk Widgets. widget name arguments = basic Tk syntax button calls tcl code when pushed checkbutton on/off (toggle) button entry text-entry widget frame frames widgets inside a box label displays text message listbox scrolled list

ziya
Download Presentation

Tcl/Tk Part 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tcl/Tk Part 2

  2. Overview of Basic Tk Widgets widget name arguments = basic Tk syntax • button calls tcl code when pushed • checkbutton on/off (toggle) button • entry text-entry widget • frame frames widgets inside a box • label displays text message • listbox scrolled list • radiobutton on/off button set; only one on • scale analog value from min to max • text text-entry widget

  3. Overview of Tcl/Tk 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

  4. Tcl/Tk Demos • BWidget – widget library application • Tktable – table application written in C • BLT – graphs application These can be used to help build new applications and are all installed in the /usr/local directory of the machines sif and tyr. You can learn much from studying the code of these demos.

  5. Running the Demos on sif and tyr • BWidget /usr/local/BWidget/demo/demo.tcl • Tktable (demos not in /usr/local) cd ~mitchell/Tktable2.8 demos/basic.tcl, demos/buttons.tcl • BLT cd /usr/local/blt/lib/blt2.4/demos /usr/local/blt/bin/bltwish spline.tcl /usr/local/blt/bin/bltwish stripchart1.tcl

More Related