I got working code under Linux to change the appearance of a TCombobox of Ttk under python 2.7. If I run the code under windows, it wont work. Im aware, that colors and also attributes of the ttk widgets are platform-dependant. Still I cannot figure out how to change the color of either the textarea or the downarrow of the combobox under windows. The code, which is working under linux is like that:
self = Tkinter.Canvas
style = ttk.Style()
style.configure('Yellow.TCombobox',background="yellow")
combo = ttk.Combobox(self,width=12,font=("Arial",8),style="Yellow.TCombobox")
I tried to find out about which attributes the TCombobox has got under windows by:
print style.layout("TCombobox")
style.configure("Yellow.TCombobox",fieldbackground="yellow")
print style.lookup("Yellow.TCombobox", 'fieldbackground')
My print output is the following:
[('Combobox.field', {'children': [('Combobox.downarrow', {'side':
'right', 'sticky': 'ns'}), ('Combobox.padding', {'children':
[('Combobox.focus', {'children':
[('Combobox.textarea', {'sticky': 'nswe'})], 'expand': '1', 'sticky':
'nswe'})], 'expand': '1', 'sticky': 'nswe'})], 'sticky': 'nswe'})]
yellow
However, although the attribute fieldbackground is changed to yellow, the appearance of the combobox does not change. So, how do I change colors?
Thanks in Advance!