Skip to content

Commit

Permalink
Workaround wxWidgets not allowing SetValue() inside a EVT_COMBOBOX ha…
Browse files Browse the repository at this point in the history
…ndler on Windows. #1865
  • Loading branch information
alranel committed Apr 19, 2014
1 parent 8018eac commit 5d10ef5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Slic3r/GUI/OptionsGroup.pm
Expand Up @@ -205,8 +205,11 @@ sub _build_field {
$field->SetValue($_[0]);
};
EVT_COMBOBOX($self->parent, $field, sub {
$field->SetValue($opt->{values}[ $field->GetSelection ]); # set the text field to the selected value
$self->_on_change($opt_key, $on_change);
# 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);
Expand Down

0 comments on commit 5d10ef5

Please sign in to comment.