After switching to Ttk instead of Tk (changeset 0f93bbe8deb7), the following code causes an error on e.g. RHEL6 machines with Tk-8.5.7 installed: $ cat -n /usr/bin/hgk | less ... 109 # end of win32 section 110 } else { 111 112 if {[ttk::style theme use] eq "default"} { 113 ttk::style theme use clam 114 } ... Apparently, 'ttk::style theme use' requires the extra arg in this Tk version (and asking for current theme may thus not be supported). $ hg view Error in startup script: wrong # args: should be "ttk::style theme use theme" while executing "ttk::style theme use" invoked from within "if {[tk windowingsystem] eq "win32"} { ...(etc) For now I've worked around it by just removing the condition (lines 112+114).
Regression. Forwarded to author of http://selenic.com/hg/rev/0f93bbe8deb7 .
Andew says: Asked guys at #tcl, it seems like the API has changed somewhere around 8.5.7, so the preferred way of getting the current theme is now [ttk::style theme use], while the deprecated (but still working) is $::ttk::currentTheme. So this patch will probably fix the issue. From: Andrew Shadura <bugzilla@tut.by> Date: Tue, 05 Feb 2013 12:58:21 +0100 ttk: Support the old way of getting the current Ttk theme: ::ttk::currentTheme diff --git a/contrib/hgk b/contrib/hgk --- a/contrib/hgk +++ b/contrib/hgk @@ -109,7 +109,12 @@ bind all <MouseWheel> [list ::tk::MouseW # end of win32 section } else { -if {[ttk::style theme use] eq "default"} { +if {[catch { + set theme [ttk::style theme use] +}]} { + set theme $::ttk::currentTheme +} +if {$theme eq "default"} { ttk::style theme use clam }
Yup, with that diff hgk starts without problems.
Patch is now in crew.
Fixed by http://selenic.com/repo/hg/rev/7365d031d457 Andrew Shadura <bugzilla@tut.by> hgk: support the old way of getting the current Ttk theme (issue3808) It seems like the API has changed somewhere around 8.5.7, so the preferred way of getting the current theme is now [ttk::style theme use], while the deprecated (but still working) is $::ttk::currentTheme. (please test the fix)