# HG changeset patch # User Andrew Shadura # Date 1362930136 -3600 # Node ID 6a0578d07024bbcba57e110f5b5db90287743e70 # Parent 870505ec3e56b2779bede780fa92f876c18da629 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. diff -r 870505ec3e56 -r 6a0578d07024 contrib/hgk --- 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