{"thread":{"id":"63499","subject":"gitk: regression when opening preferences with `want_ttk=0`","startedAt":"2025-05-22T02:55:43Z","lastAt":"2025-05-22T17:10:15Z","messageCount":3,"participants":["punk.lion0906@fastmail.com","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"518637","messageId":"087f6a4d-d276-4f1e-94a4-7423b3387b79@app.fastmail.com","threadId":"63499","inReplyTo":null,"subject":"gitk: regression when opening preferences with `want_ttk=0`","fromName":"","fromEmail":"punk.lion0906@fastmail.com","sentAt":"2025-05-22T02:55:21Z","receivedAt":"2025-05-22T02:55:43Z","isPatch":false,"sender":{"key":"punk.lion0906@fastmail.com","avatar":null},"body":"This duplicates https://github.com/j6t/gitk/issues/18.\n\nI found a regression in `gitk`'s commit 904b36b. When `gitk` is run with `want_ttk=0`\n(AKA \"use themed widgets\" set to off), I cannot open the settings dialog since that\ncommit.  It gives the following error in a modal dialog, and then opens a completely empty non-modal dialog where the settings dialog should be:\n\n```\n`invalid command name \"::combobox\"\ninvalid command name \"::combobox\"\n    while executing\n\"${NS}::combobox $page.wrapcomment -values {none char word} -state readonly  -textvariable wrapcomment\"\n    (procedure \"prefspage_general\" line 43)\n    invoked from within\n\"prefspage_general $notebook\"\n    (procedure \"doprefs\" line 27)\n    invoked from within\n\"doprefs\"\n    (procedure \"::tk::mac::ShowPreferences\" line 1)\n    invoked from within\n\"::tk::mac::ShowPreferences\"`\n```\n\nIndeed, 904b36b adds some `::combobox`es.\n\nI tested this on MacOS with Tcl/Tk 8.6, both with Homebrew-installed `gitk` from the `git-gui` 2.49.0 package, and with the master branch of https://github.com/j6t/gitk (commit 9f27318), and with that repo's 904b36b. The parent of 904b36b works fine.\n\nThe workaround is to close gitk, and set `want_ttk` to 1 in ~/.config/git/gitk, ~/.gitk, or equivalent. Completely deleting the config file at ~/.config/git/gitk also fixed the problem for me.\n\n       Ilya.\n"},{"id":"518638","messageId":"55a7668d-5227-4b7e-93f9-40d049f2e1be@app.fastmail.com","threadId":"63499","inReplyTo":"087f6a4d-d276-4f1e-94a4-7423b3387b79@app.fastmail.com","subject":"Re: gitk: regression when opening preferences with `want_ttk=0`","fromName":"","fromEmail":"punk.lion0906@fastmail.com","sentAt":"2025-05-22T03:03:35Z","receivedAt":"2025-05-22T03:03:56Z","isPatch":false,"sender":{"key":"punk.lion0906@fastmail.com","avatar":null},"body":"Since the commit probably has a different id in Git's main repo,\nhere is the description of the problematic commit 904b36b:\n\n```\ngitk: add text wrapping preferences\nAdd a new preference \"wrapdefault\" which allows enabling char/word wrap.\nImpacts all text in the ctext widget for which no other preference exists.\n\nAlso make the (existing) preference \"wrapcomment\" configurable graphically.\nIts setting impacts only the \"comment\" part of the ctext widget.\n\nSigned-off-by: Christoph Sommer <sommer@cms-labs.org>\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n```\n\nAnd the likely problematic section of the diff is:\n\n```\n@@ -11607,6 +11607,17 @@ proc prefspage_general {notebook} {\n     ${NS}::label $page.tabstopl -text [mc \"Tab spacing\"]\n     spinbox $page.tabstop -from 1 -to 20 -width 4 -textvariable tabstop\n     grid x $page.tabstopl $page.tabstop -sticky w\n+\n+    ${NS}::label $page.wrapcommentl -text [mc \"Wrap comment text\"]\n+    ${NS}::combobox $page.wrapcomment -values {none char word} -state readonly \\\n+        -textvariable wrapcomment\n+    grid x $page.wrapcommentl $page.wrapcomment -sticky w\n+\n+    ${NS}::label $page.wrapdefaultl -text [mc \"Wrap other text\"]\n+    ${NS}::combobox $page.wrapdefault -values {none char word} -state readonly \\\n+        -textvariable wrapdefault\n+    grid x $page.wrapdefaultl $page.wrapdefault -sticky w\n+\n     ${NS}::checkbutton $page.ntag -text [mc \"Display nearby tags/heads\"] \\\n         -variable showneartags\n     grid x $page.ntag -sticky w\n```\n\nHopefully, this will make it easier to find for people.\n\n        Ilya.\n\nOn Wed, May 21, 2025, at 7:55 PM, punk.lion0906@fastmail.com wrote:\n> This duplicates https://github.com/j6t/gitk/issues/18.\n>\n> I found a regression in `gitk`'s commit 904b36b. When `gitk` is run \n> with `want_ttk=0`\n> (AKA \"use themed widgets\" set to off), I cannot open the settings \n> dialog since that\n> commit.  It gives the following error in a modal dialog, and then opens \n> a completely empty non-modal dialog where the settings dialog should be:\n>\n> ```\n> `invalid command name \"::combobox\"\n> invalid command name \"::combobox\"\n>     while executing\n> \"${NS}::combobox $page.wrapcomment -values {none char word} -state \n> readonly  -textvariable wrapcomment\"\n>     (procedure \"prefspage_general\" line 43)\n>     invoked from within\n> \"prefspage_general $notebook\"\n>     (procedure \"doprefs\" line 27)\n>     invoked from within\n> \"doprefs\"\n>     (procedure \"::tk::mac::ShowPreferences\" line 1)\n>     invoked from within\n> \"::tk::mac::ShowPreferences\"`\n> ```\n>\n> Indeed, 904b36b adds some `::combobox`es.\n>\n> I tested this on MacOS with Tcl/Tk 8.6, both with Homebrew-installed \n> `gitk` from the `git-gui` 2.49.0 package, and with the master branch of \n> https://github.com/j6t/gitk (commit 9f27318), and with that repo's \n> 904b36b. The parent of 904b36b works fine.\n>\n> The workaround is to close gitk, and set `want_ttk` to 1 in \n> ~/.config/git/gitk, ~/.gitk, or equivalent. Completely deleting the \n> config file at ~/.config/git/gitk also fixed the problem for me.\n>\n>        Ilya.\n"},{"id":"518674","messageId":"086214b2-a747-4913-b279-aaf655e4869e@kdbg.org","threadId":"63499","inReplyTo":"087f6a4d-d276-4f1e-94a4-7423b3387b79@app.fastmail.com","subject":"Re: gitk: regression when opening preferences with `want_ttk=0`","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2025-05-22T17:10:07Z","receivedAt":"2025-05-22T17:10:15Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 22.05.25 um 04:55 schrieb punk.lion0906@fastmail.com:\n> This duplicates https://github.com/j6t/gitk/issues/18.\n> \n> I found a regression in `gitk`'s commit 904b36b. When `gitk` is run with `want_ttk=0`\n> (AKA \"use themed widgets\" set to off), I cannot open the settings dialog since that\n> commit.\n\nThere's a fix in this branch:\nhttps://github.com/j6t/gitk/tree/yh/fix-non-themed-combobox\n\n-- Hannes\n\n"}]}