Reputation: 35
I used ttk.Combobox to make a dropdown menu so that the user can select their sex ("sesso" in italian), and this is the code that i used:
sessi = ["M", "F"]
sesso_menu = ttk.Combobox(value=sessi, font=("Calibri", 16), state="readonly")
sesso_menu.place(x=4, y=4, height=32, width=52)
sesso_menu.current(0)
It looks like this but now want to change the font of the two variables inside the window that pops up to make them bigger, how do i do this?
Upvotes: 1
Views: 953
Reputation: 47194
You can use .option_add()
to set the font but it applies to all Combobox
:
import tkinter as tk
root = tk.Tk()
root.option_add("*TCombobox*Listbox.font", "Calibri 16")
...
Or you can get the Popdown Window of sesso_menu
via TCL command and configure the font of the listbox inside the Popdown Window:
popdown = root.tk.call("ttk::combobox::PopdownWindow", sesso_menu)
root.tk.call(f"{popdown}.f.l", "configure", "-font", "Calibri 16")
Upvotes: 6