how to make scrollable dropdown list in combobox customtkinter?

  Kiến thức lập trình

import customtkinter

customtkinter.set_appearance_mode(“System”) # Modes: system (default), light, dark
customtkinter.set_default_color_theme(“blue”) # Themes: blue (default), dark-blue, green

root = customtkinter.CTk()
global combo_box
combo_box = customtkinter.CTkComboBox(root, values=[“Java”, “CSS”, “Python”, “PHP”, “HTML”,”C#”,”JavaScript”,”Ruby”,”C”,”C++”])
combo_box.pack(padx=20, pady=20)

def on_tab_complete(event):
available_options = [“Java”, “CSS”, “Python”]
current_text = combo_box.get()
completions = [option for option in available_options if option.lower().startswith(current_text.lower())]
if completions:
combo_box.configure(values=completions)
else:
combo_box.configure(values=(” “))

def call_on_tab_complete_twice(event):
on_tab_complete(event)
root.after(10, lambda: on_tab_complete(event))

combo_box.bind(“”, call_on_tab_complete_twice)

root.mainloop()

that is my code. i want the combobox list have a scrollbar

New contributor

Erlan Nauval Q is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT