2

I am looking for a PysimpleGUI way to create dropdown menus. Currently, I can create ComboBoxes as such:

import PySimpleGui as sg
sg.Combo(list1, size = params)

This creates an Input box and a dropdown list with a slider populated by list1 elements.


However, my users are very sloppy with inputs and I'd like to restrict them to a simple dropdown list.


Now I know I could maybe use the ListBox element but it doesn't have a slider/seems much less versatile than Combo.


What other arguments could I pass to Combo to make this work?


NB:In the documentation they state that Combo == InputCombo == Drop == DropDown but without giving more details but it confuses me a lot.

sovann
  • 117
  • 1
  • 1
  • 12

2 Answers2

2

There is no slider when ListBox is has not enough entries however one appears when enough are added.

sg.Listbox(list(df_names.NAMES), size=(20,4), enable_events=False, key='_LIST_')

sovann
  • 117
  • 1
  • 1
  • 12
2

Set the readonly to True

sg.Combo(..., readonly=True)

Jerry wu
  • 802
  • 8
  • 17