From 74157dd1cb9adada35c2079c1e053e0b4b2dec19 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 7 Mar 2023 12:13:57 -0500 Subject: meander: pick ending point far from starting point (#2095) --- lib/extensions/params.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/extensions/params.py') diff --git a/lib/extensions/params.py b/lib/extensions/params.py index 6c0f12c5..802086d8 100644 --- a/lib/extensions/params.py +++ b/lib/extensions/params.py @@ -149,11 +149,11 @@ class ParamsTab(ScrolledPanel): def update_combo_state(self, event=None): self.update_choice_state(event, True) - def get_combo_value_index(self, param, options): + def get_combo_value_index(self, param, options, default): for option in options: if option.id == param: return options.index(option) - return 0 + return default def pair_changed(self, value): new_value = not value @@ -407,8 +407,7 @@ class ParamsTab(ScrolledPanel): input.Append(option.name, image, option) if not param.options: input.Append(_('No options available'), ParamOption('not_available')) - - value = self.get_combo_value_index(param.values[0], param.options) + value = self.get_combo_value_index(param.values[0], param.options, param.default or 0) input.SetSelection(value) input.Bind(wx.EVT_COMBOBOX, self.changed) input.Bind(wx.EVT_COMBOBOX, self.update_combo_state) -- cgit v1.2.3