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:
parent
15d7aaaa50
commit
d282cc9657
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue