git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitk: use makedroplist, not ::combobox

From
Mark Levedahl <mlevedahl@gmail.com>
Date
May 10, 2025, 17:17 UTC
Message-ID
<20250510171723.32163-1-mlevedahl@gmail.com>

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
Next: Johannes Sixt
Message 1 of 2 in “gitk: use makedroplist, not ::combobox”
  1. gitk: use makedroplist, not ::comboboxMark Levedahl, May 10, 2025
  2. Johannes SixtMay 10, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.