pythontkinter

Tkinter optionmenu, set max height for the dropdown


How do I have to configure optionsmenu in tkinter, so that the drop down box does not show me more than (for example) 5 entries? I have around 50 entries and would like optionmenu to create a little box where I have to scroll up and down to find the entry that I want.


Solution

  • Unfortunately you can't do it but a ComboBox might do the trick. It is a entry box combined with a dropdown so you can search for options inside!

    It has an attribute height which limits the height, therefore limiting the amount of options shown.