[Tkinter-discuss] Change control styles ttk.Scrollbar

Michael Lange klappnase at web.de
Thu Dec 23 18:53:48 CET 2010


Hi,

Thus spoketh craf <prog at vtr.net> 
unto us on Thu, 23 Dec 2010 10:49:27 -0300:

> Hi.
> 
> Is it possible to change the background color of a control
> ttk.Scrollbar?.
> In its standard options is Style, but this seems not to work:
> 
> Example:
> 
> s.configure('TScrollbar', background='#cccccc') no works.
> 
> Thanks in advance.

Can you show a more detailed example of what you wanted to schieve and
what exactly happened?
I tried this short snippet, which works as expected:

from Tkinter import *
import ttk

root = Tk()
s=ttk.Style()
s.configure('TScrollbar', background='red')
sb = ttk.Scrollbar(root)
sb.pack(side='right', fill='y')
root.mainloop()

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

No one wants war.
		-- Kirk, "Errand of Mercy", stardate 3201.7


More information about the Tkinter-discuss mailing list