changeset 18805:6a0578d07024

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.
author Andrew Shadura <bugzilla@tut.by>
date Sun, 10 Mar 2013 16:42:16 +0100
parents 870505ec3e56
children 932f5d3587c9
files contrib/hgk
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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