diff options
author | treectrl <treectrl> | 2005-03-29 20:26:13 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2005-03-29 20:26:13 (GMT) |
commit | 8892641fcc63266bc08b6390c252e79525a7702f (patch) | |
tree | 14ab3b26eee716fb0f4a8eaaa7d7681a3d6fc1dc /demos/bitmaps.tcl | |
parent | 511cd686d18fc9b56910c78232a646ce6e70302e (diff) | |
download | tktreectrl-8892641fcc63266bc08b6390c252e79525a7702f.zip tktreectrl-8892641fcc63266bc08b6390c252e79525a7702f.tar.gz tktreectrl-8892641fcc63266bc08b6390c252e79525a7702f.tar.bz2 |
Added standard block comments to highlight steps of creating and using a treectrl widget.
Diffstat (limited to 'demos/bitmaps.tcl')
-rw-r--r-- | demos/bitmaps.tcl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/demos/bitmaps.tcl b/demos/bitmaps.tcl index a129a39..4f0f700 100644 --- a/demos/bitmaps.tcl +++ b/demos/bitmaps.tcl @@ -5,12 +5,24 @@ proc DemoBitmaps {} { set T .f2.f1.t + # + # Configure the treectrl widget + # + $T configure -showroot no -showbuttons no -showlines no \ -selectmode browse -orient horizontal -wrap "5 items" \ -showheader no -backgroundimage sky + # + # Create columns + # + $T column create -itembackground {gray90 {}} + # + # Create elements + # + $T element create elemTxt text -fill [list $::SystemHighlightText {selected focus}] $T element create elemSelTxt rect -fill [list $::SystemHighlight {selected focus}] \ -showfocus yes @@ -21,6 +33,10 @@ proc DemoBitmaps {} { -background linen \ -bitmap {question {selected}} + # + # Create styles using the elements + # + set S [$T style create STYLE -orient vertical] $T style elements $S {elemSelBmp elemBmp elemSelTxt elemTxt} $T style layout $S elemSelBmp -union elemBmp \ @@ -32,6 +48,10 @@ proc DemoBitmaps {} { # Set default item style $T configure -defaultstyle [list $S] + # + # Create items and assign styles + # + set bitmapNames [list error gray75 gray50 gray25 gray12 hourglass info \ questhead question warning] |