wxRadioButton on wxPopupTransientWindow causing Assert failure

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

wxRadioButton on wxPopupTransientWindow causing Assert failure

Post by Anil8753 »

I have a wxPopupTransientWindow and I need to place wxRadioButton on wxPopupTransientWindow using sizers.
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();
}
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7478
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxRadioButton on wxPopupTransientWindow causing Assert failure

Post by ONEEYEMAN »

Hi,
Please post to the wx-users ML where you will be able to reach core wx developers.

Thank you.
Post Reply