To defocus the ComboBox widgets, I use the "Defocus" custom function written in my example:
from tkinter import *
from tkinter import ttk
def Defocus(event):
event.widget.master.focus_set()
parent=Tk()
parent.geometry("530x280+370+100")
parent.title("TEST")
parent.configure(background="#f0f0f0")
parent.minsize(485, 280)
SV=StringVar()
SV.set("I hate to see the bold text..")
MenuComboBox=ttk.Combobox(parent, state="readonly", values=("I hate to see the bold text..", "ciao", "hola", "hello"), textvariable=SV, width=50)
MenuComboBox.bind("<FocusIn>", Defocus)
MenuComboBox.place(x=20, y=20)
SV2=StringVar()
SV2.set("I hate to see the bold text..")
MenuComboBox2=ttk.Combobox(parent, state="readonly", values=("I hate to see the bold text..", "ciao", "hola", "hello"), textvariable=SV2, width=50)
MenuComboBox2.bind("<FocusIn>", Defocus)
MenuComboBox2.place(x=20, y=60)
parent.mainloop()
it works but not at all, it has a "bad behaviour" for my point of view. the text in the ComboBox widgets became bold and I don't like it (see my attached GIF). I have two questions:
how can I improve my custom "Defocus" function to take off the "bold option" in the ComboBox widgets?
is there a way to change the default style of the ComboBox widgets to delete the focus and the bold text options? in this way, I can avoid to use my custom function every times I have to use a ComboBox widget.
