I was wondering what is the difference between ComboBox and OptionMenu widgets in python tkinter. It seems that they allow to do the same thing, but Combobox is only available in ttk.
Does anyone could explain the difference?
Thanks
The OptionMenu
is a button with a menu attached. The menu typically grows in height until it reaches the edge of the screen. The choices are fixed, and the user can't type in their own value.
A Combobox
is in effect an Entry
widget with a dropdown listbox. The user has the ability (if properly configured) to type into the combobox or pick from the dropdown list. The dropdown list is typically constrained to a handful of rows, with a scrollbar when the list gets to long to fit.
The Combobox
is also a bit easier to add and remove items after the widget has been created. The OptionMenu
was designed to have a static number of items that are set when the widget is created.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With