]>
git.zerfleddert.de Git - micropolis/blob - src/tk/library/demos/mkIcon.tcl
1931376c2f8a05773e5f62c0e4202fdcb7850007
3 # Create a top-level window that displays a bunch of iconic
7 # w - Name to use for new top-level window.
9 proc mkIcon
{{ w .icon
}} {
14 wm title
$w "Iconic Button Demonstration"
15 wm iconname
$w "Icons"
16 message $w .msg
-font -Adobe - times
- medium
- r
- normal
--* -180 * -aspect 300 \
17 -text "This window shows three buttons that display bitmaps instead of text. On the left is a regular button, which changes its bitmap when you click on it. On the right are two radio buttons. Click the \" OK \" button when you're done."
18 frame $w .
frame -borderwidth 10
19 pack append $w .
frame \
20 [ button $w .
frame .b1
-bitmap @ $tk_library / demos
/ bitmaps
/ flagdown
\
21 -command "iconCmd $w .frame.b1" ] { left expand
} \
22 [ frame $w .
frame .right
] { left expand
}
23 radiobutton $w .
frame .right.b2
-bitmap @ $tk_library / demos
/ bitmaps
/ letters
\
25 radiobutton $w .
frame .right.b3
-bitmap @ $tk_library / demos
/ bitmaps
/ noletters
\
27 pack append $w .
frame .right
$w .
frame .right.b2
{ top expand
} \
28 $w .
frame .right.b3
{ top expand
}
29 button $w .ok
-text OK
-command "destroy $w "
31 pack append $w $w .msg
{ top
frame c
} $w .
frame { top expand fill
} \
37 set bitmap [ lindex [ $w config
-bitmap ] 4 ]
38 if { $bitmap == "@ $tk_library /demos/bitmaps/flagdown" } {
39 $w config
-bitmap @ $tk_library / demos
/ bitmaps
/ flagup
41 $w config
-bitmap @ $tk_library / demos
/ bitmaps
/ flagdown