Python Tkinter: OptionMenu modify dropdown list width

James the Great picture James the Great · Sep 23, 2014 · Viewed 9.2k times · Source

I have created an OptionMenu from Tkinter with a columnspan of 2. However, the dropdown list/menu does not match the width, so it does not look good. Any idea on how to match their width?

self.widgetVar = StringVar(self.top)
choices = ['', 'wire', 'register']
typeOption = OptionMenu(self.top, self.widgetVar, *choices)
typeOption.grid(column = 0, columnspan = 2, row = 0, sticky = 'NSWE', padx = 5, pady = 5)

Answer

Bryan Oakley picture Bryan Oakley · Oct 27, 2015

There is no way to change the width of the dropdown.

You might want to consider the ttk.Combobox widget. It has a different look that might be what you're looking for.