From 9a16ac4394fbac436df398fdb35aecf256d4cda4 Mon Sep 17 00:00:00 2001 From: simon Date: Sat, 14 Mar 2026 00:43:53 -0700 Subject: [PATCH] widgets: change dropdown style to readonly The Dropdown widget's wx.ComboBox creation used the wx.CB_DROPDOWN style flag, which allows selection but also makes the selection editable. wx.CB_READONLY allows selection but without editing, so the selection will always be in the enumerated choice. See: https://docs.wxpython.org/wx.ComboBox.html#wx-combobox Fixes: #925 --- gooey/gui/components/widgets/dropdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gooey/gui/components/widgets/dropdown.py b/gooey/gui/components/widgets/dropdown.py index bb104e1e..09fe07fa 100644 --- a/gooey/gui/components/widgets/dropdown.py +++ b/gooey/gui/components/widgets/dropdown.py @@ -21,7 +21,7 @@ def getWidget(self, parent, *args, **options): # str conversion allows using stringyfiable values in addition to pure strings value=str(default), choices=[str(default)] + [str(choice) for choice in self._meta['choices']], - style=wx.CB_DROPDOWN) + style=wx.CB_READONLY) def setOptions(self, options): with self.retainSelection():