Allow modifying wxComboBox from its CLOSEUP handler with wxGTK2
Doing this resulted in GTK errors about invalid iterators, so postpone the generation of the CLOSEUP event for slightly later to allow changing the combobox contents from it with GTK+ 2 (this is not necessary with GTK+ 3). Also add a demon of a dynamic combobox, creating and destroying its items on the fly, to the widgets sample. Closes #17223.
This commit is contained in:
committed by
Vadim Zeitlin
parent
62b5e1b2ef
commit
a216806c99
@@ -55,7 +55,19 @@ gtkcombobox_popupshown_callback(GObject *WXUNUSED(gobject),
|
||||
: wxEVT_COMBOBOX_CLOSEUP,
|
||||
combo->GetId() );
|
||||
event.SetEventObject( combo );
|
||||
combo->HandleWindowEvent( event );
|
||||
|
||||
#ifndef __WXGTK3__
|
||||
// Process the close up event once the combobox is already closed with GTK+
|
||||
// 2, otherwise changing the combobox from its handler result in errors.
|
||||
if ( !isShown )
|
||||
{
|
||||
combo->GetEventHandler()->AddPendingEvent( event );
|
||||
}
|
||||
else
|
||||
#endif // GTK+ < 3
|
||||
{
|
||||
combo->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user