Workaround wxWidgets not allowing SetValue() inside a EVT_COMBOBOX handler on Windows. #1865
This commit is contained in:
parent
8018eac0f0
commit
5d10ef514f
1 changed files with 5 additions and 2 deletions
|
@ -205,9 +205,12 @@ sub _build_field {
|
||||||
$field->SetValue($_[0]);
|
$field->SetValue($_[0]);
|
||||||
};
|
};
|
||||||
EVT_COMBOBOX($self->parent, $field, sub {
|
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
|
$field->SetValue($opt->{values}[ $field->GetSelection ]); # set the text field to the selected value
|
||||||
$self->_on_change($opt_key, $on_change);
|
$self->_on_change($opt_key, $on_change);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
EVT_TEXT($self->parent, $field, $on_change);
|
EVT_TEXT($self->parent, $field, $on_change);
|
||||||
EVT_KILL_FOCUS($field, $on_kill_focus);
|
EVT_KILL_FOCUS($field, $on_kill_focus);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue