Workaround wxWidgets not allowing SetValue() inside a EVT_COMBOBOX handler on Windows. #1865

This commit is contained in:
Alessandro Ranellucci 2014-04-19 18:42:52 +02:00
parent 8018eac0f0
commit 5d10ef514f

View file

@ -205,9 +205,12 @@ sub _build_field {
$field->SetValue($_[0]);
};
EVT_COMBOBOX($self->parent, $field, sub {
# Without CallAfter, the field text is not populated on Windows.
Slic3r::GUI->CallAfter(sub {
$field->SetValue($opt->{values}[ $field->GetSelection ]); # set the text field to the selected value
$self->_on_change($opt_key, $on_change);
});
});
EVT_TEXT($self->parent, $field, $on_change);
EVT_KILL_FOCUS($field, $on_kill_focus);
} else {