Exercises, examples and other material relating to training module T223. This topic is presented on public course
Tcl/Tk
Tcl - the Tk Toolkit - The Graphic Application of Tcl through Tk
This course takes the programmer who's already
learnt to program in Tcl forward into the ... http://www.wellho.net/course/tkfull.html [course] |
If you're writing a GUI based application, you'll need to hold pertinent information in variables in your program, AND display that pertinent information ... http://www.wellho.net/mouth/596_The- ... iable.html [short article] |
Let me make two statements:
1. When you are popping up a new window from your program, the very last thing you want to see happen is for the window to ... http://www.wellho.net/mouth/1475_Tcl ... nning.html [short article] |
#!/usr/bin/wish
# Count accesses from a series of computers to a server.
proc report {} {
global hosts hits
set chosen [.choose curselection]
... http://www.wellho.net/resources/ex.php4?item=t223/listbox1 [code sample] |
#!/usr/bin/wish
proc tellme {} {
global form
foreach line [array names form] {
puts "$line: $form($line)"
}
... http://www.wellho.net/resources/ex.php4?item=t223/form [code sample] |
package require Tktable
# A Tktable is a tabulator widget - it lets you
# specify data to display and manage in rows and
# columns from an array.
array ... http://www.wellho.net/resources/ex.php4?item=t223/tkt [code sample] |
#!/usr/bin/wish
# Text Widget - first easy example
text .texdemo -width 40 -height 10
pack .texdemo
.texdemo insert end "There was a language called ... http://www.wellho.net/resources/ex.php4?item=t223/tktxt [code sample] |
The Entry, text and listbox widgets provide a user data entry and edit capability which is highly configurable by the programmer - you can write a complete editor using a text widget if you like. ĘThis module covers the three text-ish widgets in detail.
This topic is presented on public course
Tcl/Tk
Examples from our training material
| form | Form using Tk entry widget |
| form2 | Second form using Tk entry widget. |
| lbex | Sample answer - listbox to choose types of fruit. |
| listbox1 | Tk listbox example |
| listbox2 | Tk second listbox example (code snippet only). |
| teditor | Simple text editor in Tk |
| tkt | A Tktable is a tabulator widget in Tcl/Tk |
| tktext | a Tk text widget used as a vehicle for custom text editing |
| tktx2 | Marks and tags and editing in a Tk text widget |
| tktxt | Tk - Text Widget - first easy example |
Pictures
On site training in Tk
Background information
Some modules are
available for download as a sample of our material or under an
Open Training Notes License for free download from
http://www.training-notes.co.uk.
Topics covered in this module
The listbox widget.
Scrolling a listbox.
The entry widget.
The text widget.
Text indices.
Text marks and tags.
Index arithmetic.
Editing facilities.
Other operations on text widgets.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Tcl/Tk, Expect,
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if
you live in a different
country or continent to us.
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre. Also
available is the Opentalk
Forum for discussion of technical questions.