prompt dialog tcl tk

iwidgets::promptdialog .pd \
 -labeltext "Enter your security key" \
 -title "Accessing Security Site" \
 -modality application

##
## Hide Apply; don't need it. Bring
## back Help though; it is hidden by
## default
##
.pd show Help
.pd hide Apply

.pd buttonconfigure Help \
 -command {puts "this is the help system"}

##
## Give focus to the entry widget
##
focus [.pd component prompt component entry]

##
## Center and activate
##
.pd center
if {[.pd activate]} {
set aa [.pd get]
 puts "You have entered your security key $aa"
} else {
 puts "Good-bye!"
}

posted @ 2011-05-03 21:41  greencolor  阅读(214)  评论(0)    收藏  举报