summaryrefslogtreecommitdiff
path: root/itcl/iwidgets3.0.0/demos/selectiondialog
blob: b1eceb1983e0c4df9c9f7cb303fd99c87bc57213 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# ----------------------------------------------------------------------
#  DEMO: selectiondialog in [incr Widgets]
# ----------------------------------------------------------------------
#\
exec itkwish "$0" ${1+"$@"}
package require Iwidgets 3.0

# itkwish interprets the rest...
# ----------------------------------------------------------------------
option add *textBackground seashell

iwidgets::selectiondialog .sd -modality application
.sd configure -selectionlabel "Font:"

.sd insert items end Ariel Courier Helvetica Knarly Lucida \
    Rumpus Symbol Times "Zapf Dingbats"

button .select -text "Font..." -command {
    if {[.sd activate]} {
        puts "selected: [.sd get]"
    } else {
        puts "cancelled"
    }
}
pack .select -side left