Update tk to version 8.5.5
[msysgit.git] / mingw / lib / tk8.5 / demos / bitmap.tcl
blobe439d092c40f587765825349e86dcc36e4987a7e
1 # bitmap.tcl --
3 # This demonstration script creates a toplevel window that displays
4 # all of Tk's built-in bitmaps.
6 # RCS: @(#) $Id: bitmap.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $
8 if {![info exists widgetDemo]} {
9 error "This script should be run from the \"widget\" demo."
12 package require Tk
14 # bitmapRow --
15 # Create a row of bitmap items in a window.
17 # Arguments:
18 # w - The window that is to contain the row.
19 # args - The names of one or more bitmaps, which will be displayed
20 # in a new row across the bottom of w along with their
21 # names.
23 proc bitmapRow {w args} {
24 frame $w
25 pack $w -side top -fill both
26 set i 0
27 foreach bitmap $args {
28 frame $w.$i
29 pack $w.$i -side left -fill both -pady .25c -padx .25c
30 label $w.$i.bitmap -bitmap $bitmap
31 label $w.$i.label -text $bitmap -width 9
32 pack $w.$i.label $w.$i.bitmap -side bottom
33 incr i
37 set w .bitmap
38 catch {destroy $w}
39 toplevel $w
40 wm title $w "Bitmap Demonstration"
41 wm iconname $w "bitmap"
42 positionWindow $w
44 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."
45 pack $w.msg -side top
47 ## See Code / Dismiss buttons
48 set btns [addSeeDismiss $w.buttons $w]
49 pack $btns -side bottom -fill x
51 frame $w.frame
52 bitmapRow $w.frame.0 error gray12 gray25 gray50 gray75
53 bitmapRow $w.frame.1 hourglass info question questhead warning
54 pack $w.frame -side top -expand yes -fill both