Window Dumps of the Itcl Widgets

These illustrations show some example widgets created with these Itcl classes and the Tcl commands which generated them.

Tabgroups, Focus Highlighting and Highlighting Buttons

dialog .dlg -title "Highlighting Example" tabgroup .dlg.form -relief raised -borderwidth 1 # Create frames to align the labels and entries frame .dlg.form.f1 frame .dlg.form.f2 pack .dlg.form.f1 -side left -fill y pack .dlg.form.f2 -side right -fill y # Create the labels and entries label .dlg.form.l1 -borderwidth 2 -relief flat -text "Type here:" label .dlg.form.l2 -borderwidth 2 -relief flat -text "And here:" entry .dlg.form.e1 -borderwidth 2 -relief sunken entry .dlg.form.e2 -borderwidth 2 -relief sunken # Pack the labels and entries into the alignment frames pack .dlg.form.l1 .dlg.form.l2 \ -in .dlg.form.f1 -side top -fill x -padx 4 -pady 4 pack .dlg.form.e1 .dlg.form.e2 \ -in .dlg.form.f2 -side top -fill x -padx 4 -pady 4 # Get the "form" tabgroup to manage keyboard traversal between the # entries. .dlg.form manage -notab -nohorizontal .dlg.form.e1 .dlg.form.e2 pack .dlg.form -side top -fill x tabgroup .dlg.buttons -relief raised -borderwidth 1 # Create two highlighting buttons hbutton .dlg.buttons.ok -text "Ok" -width 8 \ -command "puts stdout \x07" hbutton .dlg.buttons.cancel -text "Cancel" -width 8 \ -command "puts stdout \x07" # Attach the Ok button to the two entries so that they are highlighted # when the focus is in the entries and that pressing Return in the # entries invokes the Ok button. Also attach the cancel button to the # entries so that pressing Escape in the entries invokes the cancel # button. .dlg.buttons.ok attach .dlg.form.e1 .dlg.form.e2 .dlg.buttons.cancel attach -cancel .dlg.form.e1 .dlg.form.e2 pack .dlg.buttons.ok .dlg.buttons.cancel \ -side left -expand yes -padx 8 -pady 8 # Get the "buttons" tabgroup to manage keyboard traversal between the # buttons. .dlg.buttons manage .dlg.buttons.ok .dlg.buttons.cancel pack .dlg.buttons -side bottom -fill x .dlg center

A Message Box Widget

msgbox .msg -relief raised -borderwidth 1 -transient . -bitmap error \ -text {File ".wishrc" does not exist} -aspect 300 .msg center

A File Selector Widget

fileselector .file -title "Load File" -filter *.tcl

A Scrolled Area Widget (example use)

A Treemap Widget (example use)


Nat Pryce (np2@doc.ic.ac.uk)