Python provides a variety of GUI (Graphic User Interface) types such as PyQT, Tkinter, Kivy, WxPython, and PySide. Among them,
tkinter is the most commonly used GUI module in Python since it is simple and easy to understand. The word Tkinter comes from the Tk interface. The tkinter module is available in Python standard library which has to be imported while writing a program in Python to generate a GUI.
Note: Tkinter(capital T) is different from the tkinter. Tkinter is used in Python2.x and is changed to tkinter in Python.3x.
Combobox is a combination of Listbox and an entry field. It is one of the Tkinter widgets where it contains a down arrow to select from a list of options. It helps the users to select according to the list of options displayed. When the user clicks on the drop-down arrow on the entry field, a pop up of the scrolled Listbox is displayed down the entry field. The selected option will be displayed in the entry field only when an option from the Listbox is selected.
combobox = ttk.Combobox(master, option=value, ...)
Example 1: Combobox widget without setting a default value.
Example 2: Combobox with initial default values.
We can also set the initial default values in the Combobox widget as shown in the below sample code.
- Python Tkinter - Text Widget
- Python Tkinter - ScrolledText Widget
- Python Tkinter - Frame Widget
- Python Tkinter - Entry Widget
- Python Tkinter - Scale Widget
- Python Tkinter - ListBox Widget
- Python Tkinter - Canvas Widget
- Progressbar widget in Tkinter | Python
- Python Tkinter - Toplevel Widget
- Python | Menu widget in Tkinter
- Python Tkinter - Menubutton Widget
- Python Tkinter - Checkbutton Widget
- Python | PanedWindow Widget in Tkinter
- Python Tkinter - MessageBox Widget
- Creating Tabbed Widget With Python-Tkinter
- Python Tkinter - Validating Entry Widget
- Autocmplete ComboBox in Python-Tkinter
- Tkinter - Read only Entry Widget
- Create Find and Replace features in Tkinter Text Widget
- Tkinter | Adding style to the input text using ttk.Entry widget
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.