hgk: update backgroud colour when Ttk is available
Ttk doesn't automatically set up Tk colour palette.
Because of that, Ttk controls look differently when used
together with old Tk controls. When we use Ttk controls,
we first query if we have any setting for the client
background, and if we do, we update Tk palette as well.
--- a/contrib/hgk Tue Oct 16 15:31:56 2012 +0200
+++ b/contrib/hgk Sun Mar 10 16:42:16 2013 +0100
@@ -30,6 +30,8 @@
interp alias {} ttk::label {} label
interp alias {} ttk::scrollbar {} scrollbar
interp alias {} ttk::optionMenu {} tk_optionMenu
+
+ proc updatepalette {} {}
} else {
proc ::ttk::optionMenu {w varName firstValue args} {
upvar #0 $varName var
@@ -46,6 +48,11 @@
}
return $w.menu
}
+ proc updatepalette {} {
+ catch {
+ tk_setPalette background [ttk::style lookup client -background]
+ }
+ }
}
if {[tk windowingsystem] eq "win32"} {
@@ -120,6 +127,7 @@
}
+updatepalette
# Unify right mouse button handling.
# See "mouse buttons on macintosh" thread on comp.lang.tcl