Web Analytics Made Easy - Statcounter
Skip to content

Combo

Combo call reference

Also known as a drop-down list. Only required parameter is the list of choices. The return value is a string matching what's visible on the GUI.

layout = [[sg.Combo(['Choice 1', 'Choice 2', 'Choice 3', 'Choice 4'], default_value='Choice 3')]]

Events

If events are enabled for the element, then the Combo's key will be returned as an event when an item is chosen or return key is pressed if manually entering a string

Values Dictionary

The item chosen.

Important - If you passed a list of objects as the values to shoe in your Combo, then the __str__ method of your object will be used to display the values in the Window. You will be given the actual object in the values dictionary, not the string that was displayed!

Read-Only Mode

If you set the read only parameter to True, then the user will not be able to type their own values into the Combo. They can only choose from your list.