Update tk to version 8.5.11
[git/jnareb-git.git] / mingw / lib / tk8.5 / demos / bitmap.tcl
blob453987d2376ab6c4813ba1052926510b4c11c114
1 # bitmap.tcl --
3 # This demonstration script creates a toplevel window that displays
4 # all of Tk's built-in bitmaps.
6 if {![info exists widgetDemo]} {
7 error "This script should be run from the \"widget\" demo."
10 package require Tk
12 # bitmapRow --
13 # Create a row of bitmap items in a window.
15 # Arguments:
16 # w - The window that is to contain the row.
17 # args - The names of one or more bitmaps, which will be displayed
18 # in a new row across the bottom of w along with their
19 # names.
21 proc bitmapRow {w args} {
22 frame $w
23 pack $w -side top -fill both
24 set i 0
25 foreach bitmap $args {
26 frame $w.$i
27 pack $w.$i -side left -fill both -pady .25c -padx .25c
28 label $w.$i.bitmap -bitmap $bitmap
29 label $w.$i.label -text $bitmap -width 9
30 pack $w.$i.label $w.$i.bitmap -side bottom
31 incr i
35 set w .bitmap
36 catch {destroy $w}
37 toplevel $w
38 wm title $w "Bitmap Demonstration"
39 wm iconname $w "bitmap"
40 positionWindow $w
42 label $w.msg -font $font -wraplength 4i -justify left -text "This window displays all of Tk's built-in bitmaps, along with the names you can use for them in Tcl scripts."
43 pack $w.msg -side top
45 ## See Code / Dismiss buttons
46 set btns [addSeeDismiss $w.buttons $w]
47 pack $btns -side bottom -fill x
49 frame $w.frame
50 bitmapRow $w.frame.0 error gray12 gray25 gray50 gray75
51 bitmapRow $w.frame.1 hourglass info question questhead warning
52 pack $w.frame -side top -expand yes -fill both