Bugfix: wxComboBox left blank after menu item selection on MSW due to an undocumented wxWidgets issue. #2361
This commit is contained in:
parent
e9166a8fe6
commit
b0aa1260e2
1 changed files with 12 additions and 2 deletions
|
@ -231,7 +231,7 @@ use Moo;
|
|||
extends 'Slic3r::GUI::OptionsGroup::Field::wxWindow';
|
||||
|
||||
use List::Util qw(first);
|
||||
use Wx qw(:misc :combobox);
|
||||
use Wx qw(wxTheApp :misc :combobox);
|
||||
use Wx::Event qw(EVT_COMBOBOX EVT_TEXT);
|
||||
|
||||
sub BUILD {
|
||||
|
@ -258,7 +258,17 @@ sub BUILD {
|
|||
$label = $value;
|
||||
}
|
||||
|
||||
$field->SetValue($label);
|
||||
# The MSW implementation of wxComboBox will leave the field blank if we call
|
||||
# SetValue() in the EVT_COMBOBOX event handler, so we postpone the call.
|
||||
wxTheApp->CallAfter(sub {
|
||||
my $dce = $self->disable_change_event;
|
||||
$self->disable_change_event(1);
|
||||
|
||||
# ChangeValue() is not exported in wxPerl
|
||||
$field->SetValue($label);
|
||||
|
||||
$self->disable_change_event($dce);
|
||||
});
|
||||
|
||||
$self->disable_change_event($disable_change_event);
|
||||
$self->_on_change($self->option->opt_id);
|
||||
|
|
Loading…
Reference in a new issue