2 # Tcl ignores the next line -*- tcl -*- \
5 # This is an implementation of a simple yes no dialog
6 # which is injected into the git commandline by git gui
7 # in case a yesno question needs to be answered.
10 set use_ttk
[package vsatisfies
[package provide Tk
] 8.5]
16 puts stderr
"Usage: $argv0 <question>"
19 set prompt
[join $argv " "]
23 ${NS}::label .t.m
-text $prompt -justify center
-width 40
24 .t.m configure
-wraplength 400
25 pack .t.m
-side top
-fill x
-padx 20 -pady 20 -expand 1
26 pack .t
-side top
-fill x
-ipadx 20 -ipady 20 -expand 1
29 ${NS}::frame .b.left
-width 200
30 ${NS}::button .b.
yes -text Yes
-command yes
31 ${NS}::button .b.no
-text No
-command no
34 pack .b.left
-side left
-expand 1 -fill x
35 pack .b.
yes -side left
-expand 1
36 pack .b.no
-side right
-expand 1 -ipadx 5
37 pack .b
-side bottom
-fill x
-ipadx 20 -ipady 15
39 bind .
<Key-Return
> {exit 0}
40 bind .
<Key-Escape
> {exit 1}
50 wm title .
"Question?"