But I see there an Assert failure if I do this.
I found wxCHECK_RET( tlw, wxT("radio button outside of TLW?") ); assert fails.
I do not know what is the reason for putting this assert and stop using wxRadioButton with wxPopupTransientWindow. Other controls wxCheckBox, wxSpinCtrl, wxButton etc work fine.
msw/radiobut.cpp
Code: Select all
void wxRadioButton::SetValue(bool value)
{
// if we set the value of one radio button we also must clear all the other
// buttons in the same group: Windows doesn't do it automatically
//
// moreover, if another radiobutton in the group currently has the focus,
// we have to set it to this radiobutton, else the old radiobutton will be
// reselected automatically, if a parent window loses the focus and regains
// it.
wxWindow * const focus = FindFocus();
wxTopLevelWindow * const
tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
wxCHECK_RET( tlw, wxT("radio button outside of TLW?") );
wxWindow * const focusInTLW = tlw->GetLastFocus();
}