How to set the background color of a ttk.Combobox
Question: I have a problem to set background color for Combobox using tkinter ttk with
'vista' theme (I'm using Python 3). I've tried code from here [ttk.Combobox
glitch when state is read-only and out of
focus](http://stackoverflow.com/questions/18610519/ttk-combobox-glitch-when-
state-is-read-only-and-out-of-focus)

    
    
    import tkinter as tk
    from tkinter import ttk
    
    root = tk.Tk()
    combo = ttk.Combobox(root, values=['1', '2', '3'])
    combo['state'] = 'readonly'
    combo.pack()
    tk.Entry(root).pack()
    
    style = ttk.Style()
    style.map('TCombobox', selectbackground=[('readonly', 'red')])
    #style.map('TCombobox', fieldbackground=[('readonly', 'blue')]) #not working as well
    

But this will change only background for text, rest part of combobox rests
white. Also I saw a post on the tcl forum: <http://wiki.tcl.tk/15780> and I've
tried with 'fieldbackground' but it seems that tkinter ignores this parameter.
Do you have any idea how to solve it? Maybe there is a way to configure only
specific style in specific theme? I saw that for 'default' theme, the
background changes to gray color if state is 'readonly'.


Answer: This code below worked fine for me.It is important set the order of the
parameters.

`

    
    
        style = ttk.Style()
    
        style.map('TCombobox', fieldbackground=[('readonly','white')])
        style.map('TCombobox', selectbackground=[('readonly', 'white')])
        style.map('TCombobox', selectforeground=[('readonly', 'black')])
    
        self.mycombo = ttk.Combobox(self.frame,textvariable=self.combo_var,
                                    height=15,justify='left',width=21,
                                    values=lista)
    
        self.mycombo['state'] = 'readonly' # Set the state according to configure colors
        self.mycombo.bind('<<ComboboxSelected>>',
                          lambda event: self._click_combo())
    

`

