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!"
}

原文地址:https://www.cnblogs.com/greencolor/p/2035895.html