Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Change color of whole ttk::labelframe

159 views
Skip to first unread message

Alexandru

unread,
Mar 1, 2020, 1:51:34 AM3/1/20
to
Hi,

I tried to change the color of the active ttk::labelframe by using this style:

ttk::style configure Active.TLabelframe -background black

The problem is that the label in the labelframe is not affected by this style.
How can I also define the color of labels in the style for ttk::labelframes?

Thanks!
Alexandru

Francois Vogel

unread,
Mar 1, 2020, 2:44:47 AM3/1/20
to
The ttk::labelframe man page states that "The text label has a class of
TLabelframe.Label." Therefore:

ttk::style configure TLabelframe.Label -background black

F.

Alexandru

unread,
Mar 1, 2020, 8:19:30 AM3/1/20
to
Thanks.
Using this method I can change the style of all lables. I just want to change specific lables. Semething like this:

ttk::style configure Active.TLabelframe -background black
ttk::style configure Active.TLabelframe.Label -background black

But now I have two different styles and I can only have one style assigned to one specific widget.

Brad Lanam

unread,
Mar 1, 2020, 11:01:08 AM3/1/20
to
It works:

.l configure -style Active.TLabelframe
ttk::style configure Active.TLabelframe -background cyan
ttk::style configure Active.TLabelframe.Label -background green

You don't need to configure the labelframe's label's style, it
inherits the style.

Alexandru

unread,
Mar 1, 2020, 11:15:08 AM3/1/20
to
Indeed! Thanks! Problem solved.
0 new messages