public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx•de>
To: Mark Levedahl <mlevedahl@gmail•com>
Cc: git@vger•kernel.org, j6t@kdbg•org, me@yadavpratyush•com
Subject: Re: [PATCH] git-gui: use tk_messageBox for ask yes/no
Date: Thu, 28 Aug 2025 15:49:20 +0200 (CEST)	[thread overview]
Message-ID: <33e2ad25-cafa-66a4-7bde-056ebbf6a5d0@gmx.de> (raw)
In-Reply-To: <20250828133301.74328-1-mlevedahl@gmail.com>

Hi Mark,

On Thu, 28 Aug 2025, Mark Levedahl wrote:

> git-gui includes git-gui--yesno that relies upon Tk 8.5 constructs, and
> this dialog box is not supported with Tk 9.0.  Tk provides tk_messagebox
> for this same purpose, fully supported in Tk 8.5+, so use tk_messagebox
> instead.

Thank you very much!

Let's keep your patch separate, to give you full credit, and to keep
Heiko's patch as close to the original that has survived in Git for
Windows for so long.

Ciao,
Johannes

> 
> Signed-off-by: Mark Levedahl <mlevedahl@gmail•com>
> ---
>  git-gui--askyesno | 35 +++++++----------------------------
>  1 file changed, 7 insertions(+), 28 deletions(-)
> 
> diff --git a/git-gui--askyesno b/git-gui--askyesno
> index 142d1bc..cd986f2 100755
> --- a/git-gui--askyesno
> +++ b/git-gui--askyesno
> @@ -10,12 +10,6 @@ exec wish "$0" -- "$@"
>  # overridden via the optional `--title` command-line
>  # option.
>  
> -set NS {}
> -set use_ttk [package vsatisfies [package provide Tk] 8.5]
> -if {$use_ttk} {
> -	set NS ttk
> -}
> -
>  set title "Question?"
>  if {$argc < 1} {
>  	puts stderr "Usage: $argv0 <question>"
> @@ -28,25 +22,7 @@ if {$argc < 1} {
>  	set prompt [join $argv " "]
>  }
>  
> -${NS}::frame .t
> -${NS}::label .t.m -text $prompt -justify center -width 40
> -.t.m configure -wraplength 400
> -pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1
> -pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1
> -
> -${NS}::frame .b
> -${NS}::frame .b.left -width 200
> -${NS}::button .b.yes -text Yes -command {exit 0}
> -${NS}::button .b.no  -text No  -command {exit 1}
> -
> -pack .b.left -side left -expand 1 -fill x
> -pack .b.yes -side left -expand 1
> -pack .b.no -side right -expand 1 -ipadx 5
> -pack .b -side bottom -fill x -ipadx 20 -ipady 15
> -
> -bind . <Key-Return> {exit 0}
> -bind . <Key-Escape> {exit 1}
> -
> +set dlgicon {question}
>  if {$::tcl_platform(platform) eq {windows}} {
>  	set icopath [file dirname [file normalize $argv0]]
>  	if {[file tail $icopath] eq {git-core}} {
> @@ -55,9 +31,12 @@ if {$::tcl_platform(platform) eq {windows}} {
>  	set icopath [file dirname $icopath]
>  	set icopath [file join $icopath share git git-for-windows.ico]
>  	if {[file exists $icopath]} {
> -		wm iconbitmap . -default $icopath
> +		set dlgicon $icopath
>  	}
>  }
>  
> -wm title . $title
> -tk::PlaceWindow .
> +wm withdraw .
> +
> +option add *Dialog.msg.font {Sans 10}
> +set ans [tk_messageBox -icon $dlgicon -message $prompt -title $title -type yesno]
> +exit [expr $ans eq {no}]
> -- 
> 2.51.0.99.15
> 
> 
> 

  reply	other threads:[~2025-08-28 13:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26 15:29 [PATCH 0/4] git-gui: GIT_ASK_YESNO/GIT_ASKPASS patches from Git for Windows Johannes Schindelin via GitGitGadget
2019-09-26 15:29 ` [PATCH 1/4] git-gui: provide question helper for retry fallback on Windows Heiko Voigt via GitGitGadget
2019-09-29 17:11   ` Pratyush Yadav
2019-09-26 15:29 ` [PATCH 2/4] git gui: set GIT_ASKPASS=git-gui--askpass if not set yet Johannes Schindelin via GitGitGadget
2019-09-29 17:15   ` Pratyush Yadav
2019-09-26 15:29 ` [PATCH 3/4] git-gui--askyesno: allow overriding the window title Johannes Schindelin via GitGitGadget
2019-09-29 17:31   ` Pratyush Yadav
2019-09-26 15:30 ` [PATCH 4/4] git-gui--askyesno (mingw): use Git for Windows' icon, if available Johannes Schindelin via GitGitGadget
2019-09-29 18:01   ` Pratyush Yadav
2025-08-28  8:58 ` [PATCH v2 0/4] git-gui: GIT_ASK_YESNO/GIT_ASKPASS patches from Git for Windows Johannes Schindelin via GitGitGadget
2025-08-28  8:58   ` [PATCH v2 1/4] git-gui: provide question helper for retry fallback on Windows Heiko Voigt via GitGitGadget
2025-08-28  8:58   ` [PATCH v2 2/4] git gui: set GIT_ASKPASS=git-gui--askpass if not set yet Johannes Schindelin via GitGitGadget
2025-08-28 17:44     ` Johannes Sixt
2025-11-17 14:03       ` Johannes Schindelin
2025-08-28  8:58   ` [PATCH v2 3/4] git-gui--askyesno: allow overriding the window title Johannes Schindelin via GitGitGadget
2025-08-28  8:58   ` [PATCH v2 4/4] git-gui--askyesno (mingw): use Git for Windows' icon, if available Johannes Schindelin via GitGitGadget
2025-08-28 13:33     ` [PATCH] git-gui: use tk_messageBox for ask yes/no Mark Levedahl
2025-08-28 13:49       ` Johannes Schindelin [this message]
2025-08-28 21:18       ` Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=33e2ad25-cafa-66a4-7bde-056ebbf6a5d0@gmx.de \
    --to=johannes.schindelin@gmx$(echo .)de \
    --cc=git@vger$(echo .)kernel.org \
    --cc=j6t@kdbg$(echo .)org \
    --cc=me@yadavpratyush$(echo .)com \
    --cc=mlevedahl@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox