Non-standard colors for ttk::scale elememnts...

36 views
Skip to first unread message

Robert Heller

unread,
Jun 13, 2022, 4:23:49 PMJun 13
to
I am trying to use ttk::scale widgets, but with (very) non-standard colors. I
have things *mostly* set, but there is one color setting I can't seem to
figure out how to set.

Consider this piece of code:

#*****************************************************************************
#
# System :
# Module :
# Object Name : $RCSfile$
# Revision : $Revision$
# Date : $Date$
# Author : $Author$
# Created By : Robert Heller
# Created : Mon Jun 13 16:13:05 2022
# Last Modified : <220613.1622>
#
# Description
#
# Notes
#
# History
#
#*****************************************************************************
#
# Copyright (C) 2022 Robert Heller D/B/A Deepwoods Software
# 51 Locke Hill Road
# Wendell, MA 01379-9728
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#
#*****************************************************************************


package require Tk

ttk::style layout NavigationHelmThrustor \
{Vertical.Scale.trough -sticky nswe \
-children {Vertical.Scale.slider -side top -sticky {we}}}
ttk::style configure NavigationHelmThrustor \
{*}[ttk::style configure TScale]
ttk::style configure NavigationHelmThrustor \
-background green \
-troughcolor DarkOliveGreen

pack [ttk::scale .t -style NavigationHelmThrustor -orient vertical]

When you hover the pointer over the slider, its color changes to a pale grey
color. I want it to be some other color. How can I do that?

I am using Tcl/Tk 8.6 on Ubuntu 18.04 (Linux).

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
hel...@deepsoft.com -- Webhosting Services

Schelte

unread,
Jun 13, 2022, 6:10:09 PMJun 13
to
On 13/06/2022 22:23, Robert Heller wrote:
> When you hover the pointer over the slider, its color changes to a pale grey
> color. I want it to be some other color. How can I do that?
>
Add:
ttk::style map NavigationHelmThrustor -background {active blue}


Schelte.
Reply all
Reply to author
Forward
0 new messages