* [PATCH] gitk: use makedroplist, not ::combobox
@ 2025-05-10 17:17 Mark Levedahl
2025-05-10 17:52 ` Johannes Sixt
0 siblings, 1 reply; 2+ messages in thread
From: Mark Levedahl @ 2025-05-10 17:17 UTC (permalink / raw)
To: j6t; +Cc: git, Mark Levedahl
gitk offers to not use themed tk (ttk), and cannot use such on Tcl/Tk
earlier than 8.5 where ttk was introduced. To facilitate this, widgets
are switched from themed to not by use of the global ${NS}: ${NS} == ttk
to select themed widgets, "" for non-themed. The combobox widget exists
only in ttk, and proc makedroplist exists to create a combobox like
widget using only base tk widgets.
However, 904b36b815 ("gitk: add text wrapping preferences", 2024-12-05),
introduced two instances of ${NS}::combobox, and since that commit,
gitk effectively requires Tk >= 8.5 and themed widgets enabled.
Fix this by using makedropbox instead.
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
---
gitk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitk b/gitk
index 11ad639..d48982f 100755
--- a/gitk
+++ b/gitk
@@ -11736,12 +11736,12 @@ proc prefspage_general {notebook} {
grid x $page.tabstopl $page.tabstop -sticky w
${NS}::label $page.wrapcommentl -text [mc "Wrap comment text"]
- ${NS}::combobox $page.wrapcomment -values {none char word} -state readonly \
+ makedroplist $page.wrapcomment -values {none char word} -state readonly \
-textvariable wrapcomment
grid x $page.wrapcommentl $page.wrapcomment -sticky w
${NS}::label $page.wrapdefaultl -text [mc "Wrap other text"]
- ${NS}::combobox $page.wrapdefault -values {none char word} -state readonly \
+ makedroplist $page.wrapdefault -values {none char word} -state readonly \
-textvariable wrapdefault
grid x $page.wrapdefaultl $page.wrapdefault -sticky w
--
2.49.0.99.610
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] gitk: use makedroplist, not ::combobox
2025-05-10 17:17 [PATCH] gitk: use makedroplist, not ::combobox Mark Levedahl
@ 2025-05-10 17:52 ` Johannes Sixt
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Sixt @ 2025-05-10 17:52 UTC (permalink / raw)
To: Mark Levedahl; +Cc: git
Am 10.05.25 um 19:17 schrieb Mark Levedahl:
> gitk offers to not use themed tk (ttk), and cannot use such on Tcl/Tk
> earlier than 8.5 where ttk was introduced. To facilitate this, widgets
> are switched from themed to not by use of the global ${NS}: ${NS} == ttk
> to select themed widgets, "" for non-themed. The combobox widget exists
> only in ttk, and proc makedroplist exists to create a combobox like
> widget using only base tk widgets.
>
> However, 904b36b815 ("gitk: add text wrapping preferences", 2024-12-05),
> introduced two instances of ${NS}::combobox, and since that commit,
> gitk effectively requires Tk >= 8.5 and themed widgets enabled.
>
> Fix this by using makedropbox instead.
>
> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
> ---
> gitk | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gitk b/gitk
> index 11ad639..d48982f 100755
> --- a/gitk
> +++ b/gitk
> @@ -11736,12 +11736,12 @@ proc prefspage_general {notebook} {
> grid x $page.tabstopl $page.tabstop -sticky w
>
> ${NS}::label $page.wrapcommentl -text [mc "Wrap comment text"]
> - ${NS}::combobox $page.wrapcomment -values {none char word} -state readonly \
> + makedroplist $page.wrapcomment -values {none char word} -state readonly \
> -textvariable wrapcomment
> grid x $page.wrapcommentl $page.wrapcomment -sticky w
>
> ${NS}::label $page.wrapdefaultl -text [mc "Wrap other text"]
> - ${NS}::combobox $page.wrapdefault -values {none char word} -state readonly \
> + makedroplist $page.wrapdefault -values {none char word} -state readonly \
> -textvariable wrapdefault
> grid x $page.wrapdefaultl $page.wrapdefault -sticky w
>
Unfortunately, the fix is not that simple. `makedroplist` isn't just a
drop-in replacement for `${NS}::combobox`.
Allow me to prefer https://github.com/j6t/gitk/commit/c259b2ede8a74809005f81eeb6bb827b1d9692e0,
reproduced below, over this patch.
-- Hannes
From: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Subject: [PATCH] gitk: Legacy widgets doesn't have combobox
Use "proc makedroplist" function to support combobox on legacy widgets mode.
"proc makedroplist" uses "ttk::combobox" for themed mode, and uses
"tk_optionMenu" for legacy mode to get rid of the probrem.
Signed-off-by: YOKOTA Hiroshi <yokota.hgml@gmail.com>
---
gitk | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/gitk b/gitk
index 0d96597..fc1dd61 100755
--- a/gitk
+++ b/gitk
@@ -11782,13 +11782,11 @@ proc prefspage_general {notebook} {
grid x $page.tabstopl $page.tabstop -sticky w
${NS}::label $page.wrapcommentl -text [mc "Wrap comment text"]
- ${NS}::combobox $page.wrapcomment -values {none char word} -state readonly \
- -textvariable wrapcomment
+ makedroplist $page.wrapcomment wrapcomment none char word
grid x $page.wrapcommentl $page.wrapcomment -sticky w
${NS}::label $page.wrapdefaultl -text [mc "Wrap other text"]
- ${NS}::combobox $page.wrapdefault -values {none char word} -state readonly \
- -textvariable wrapdefault
+ makedroplist $page.wrapdefault wrapdefault none char word
grid x $page.wrapdefaultl $page.wrapdefault -sticky w
${NS}::checkbutton $page.ntag -text [mc "Display nearby tags/heads"] \
--
2.49.0.212.gc22db56b11.dirty
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-10 17:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-10 17:17 [PATCH] gitk: use makedroplist, not ::combobox Mark Levedahl
2025-05-10 17:52 ` Johannes Sixt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox