Fix creating wxRadioBox with no items in wxUniv

Don't select the first item if there are no items at all.

Closes #23784.
This commit is contained in:
Kvaz1r 2023-08-19 18:16:39 +03:00 committed by Vadim Zeitlin
parent 15d7aaaa50
commit d282cc9657

View file

@ -162,8 +162,10 @@ bool wxRadioBox::Create(wxWindow *parent,
wxSize actualSize = GetSize();
DoMoveWindow(actualPos.x, actualPos.y, actualSize.x, actualSize.y);
// radiobox should already have selection so select at least one item
SetSelection(0);
// Select first radio button if we have any buttons at all, as the radiobox
// should always have some selection.
if ( n != 0 )
SetSelection(0);
return true;
}