Does anybody knows how can I change the background colour of a ttk
widget? (In this case the shash of a pane, and the background of a
notebook).
I have this window:
http://www.ellogon.org/~petasis/tcl/TkRibbon/images/Ellogon-Ribbon-System-Logs.png
I want to change the background colour at the tab area (beneath Output,
Time Log & Error Log), but without loosing the native tabs.
I have a rough idea that I need to create a new "style" (is this
correct?) but I don't know how to start.
Is this feasible?
(The wiki seems too slow today, so I cannot search for the time being...)
George
I tried this:
package req Tk
ttk::style layout System.notebook {
Notebook.client -sticky nswe
}
ttk::style configure System.notebook -background red
ttk::notebook .x
for {set i 0} {$i < 10} {incr i} {
.x add [frame .x.f$i] -text $i
pack [text .x.f$i.t -height 4 -width 60]
}
pack .x -fill both -expand true
A complete failure: I only get half tabs :D
George
Ok, the following works:
ttk::style configure TNotebook -background red
But, this changes all notebooks. I tried to create a new layout:
ttk::style layout System.Notebook {
Notebook.client -sticky nswe
}
When I use it on a notebook, I get the correct colour, but the tabs do
not resize as supposed (and do with the default layout).
What is the layout I define missing?
George
If you still decide you want to change the background color of the
notebook, you don't have to create a new layout. After all, you are
not changing the layout, just the color. So simply use:
ttk::style configure System.TNotebook -background red
ttk::notebook .nb -style System.TNotebook
Schelte.
Dear Schelte,
Thanls, it works. I had no idea that I can configure a non-existing style...
George
Have a look here for a good explication http://www.tkdocs.com/tutorial/styles.html
Its not complete yet but is an excellent intro
Martyn