From 5d10ef514f3fc2ce713801baa5d294c7dc97e17c Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 19 Apr 2014 18:42:52 +0200 Subject: [PATCH] Workaround wxWidgets not allowing SetValue() inside a EVT_COMBOBOX handler on Windows. #1865 --- lib/Slic3r/GUI/OptionsGroup.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/GUI/OptionsGroup.pm b/lib/Slic3r/GUI/OptionsGroup.pm index 9e7b4cfc8..ed6e4a21f 100644 --- a/lib/Slic3r/GUI/OptionsGroup.pm +++ b/lib/Slic3r/GUI/OptionsGroup.pm @@ -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);