GIF89a;
= 0} { # set key [string index [$w.$name cget -text] $underIdx] # bind $w [list $w.$name invoke] # bind $w [list $w.$name invoke] # } } bind $w [list ::tk::AltKeyInDialog $w %A] if {$data(-default) ne ""} { bind $w { if {[winfo class %W] in "Button TButton"} { %W configure -default active } } bind $w { if {[winfo class %W] in "Button TButton"} { %W configure -default normal } } } # 6. Create bindings for , and on the dialog bind $w { if {[winfo class %W] in "Button TButton"} { %W invoke } } # Invoke the designated cancelling operation bind $w [list $w.$cancel invoke] # At the buttons have vanished, so must do this directly. bind $w.msg [list set tk::Priv(button) $cancel] # 7. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the # display (Motif style) and de-iconify it. ::tk::PlaceWindow $w widget $data(-parent) # 8. Set a grab and claim the focus too. if {$data(-default) ne ""} { set focus $w.$data(-default) } else { set focus $w } ::tk::SetFocusGrab $w $focus # 9. Wait for the user to respond, then restore the focus and # return the index of the selected button. Restore the focus # before deleting the window, since otherwise the window manager # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. vwait ::tk::Priv(button) # Copy the result now so any that happens won't cause # trouble set result $Priv(button) ::tk::RestoreFocusGrab $w $focus return $result }