macOS 26 wxRadioBox SetString() destruct layout (Issue #25831)

33 views
Skip to first unread message

rocrail

unread,
Sep 25, 2025, 8:57:17 AM (11 days ago) Sep 25
to wx-...@googlegroups.com, Subscribed
rocrail created an issue (wxWidgets/wxWidgets#25831)

wxWidgets 3.3.1/3.3.2
macOS: 26.0

Setting a translation by wxRadioBox->SetString() destructs the layout.

With SetString():
macos26-radiobox-text-setstring.png (view on web)

Without SetString():
macos26-radiobox-text.png (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25831@github.com>

rocrail

unread,
Sep 25, 2025, 8:58:28 AM (11 days ago) Sep 25
to wx-...@googlegroups.com, Subscribed
rocrail left a comment (wxWidgets/wxWidgets#25831)

See also:
https://forums.wxwidgets.org/viewtopic.php?f=23&t=52289


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25831/3333823950@github.com>

VZ

unread,
Sep 25, 2025, 8:59:19 AM (11 days ago) Sep 25
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25831)

I can't test this myself anyhow, but knowing if this can be reproduced in the widgets sample would be useful to know. And if not, having a minimal patch reproducing it would be even more valuable.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25831/3333829689@github.com>

rocrail

unread,
Sep 25, 2025, 9:05:53 AM (11 days ago) Sep 25
to wx-...@googlegroups.com, Subscribed
rocrail left a comment (wxWidgets/wxWidgets#25831)

The problem is that its not in all Dialogs the case and it seems dependent in which Sizer complex the RadioBox resides.
With a wxWidgets Sample I could not yet reproduce this behavior.

The wxWidgets did not change but macOS from 15 to 26.

I will continue to try it to reproduce it with a small example...


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25831/3333885712@github.com>

VZ

unread,
Sep 25, 2025, 9:10:37 AM (11 days ago) Sep 25
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25831)

Do the controls inside it use the static box as parent?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25831/3333922715@github.com>

rocrail

unread,
Sep 25, 2025, 9:20:35 AM (11 days ago) Sep 25
to wx-...@googlegroups.com, Subscribed
rocrail left a comment (wxWidgets/wxWidgets#25831)

OK, I can reproduce it with the minimal sample with the following code in the MyFrame::MyFrame() constructor:

// frame constructor
MyFrame::MyFrame(const wxString& title)
: wxFrame(nullptr, wxID_ANY, title)
{
// set the frame icon
SetIcon(wxICON(sample));

// If menus are not available add a button to access the about box
wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
wxButton* aboutBtn = new wxButton(this, wxID_ANY, "About...");
aboutBtn->Bind(wxEVT_BUTTON, &MyFrame::OnAbout, this);
sizer->Add(aboutBtn, wxSizerFlags().Center());


wxArrayString m_TextTypeStrings;
m_TextTypeStrings.Add(_("&Text"));
m_TextTypeStrings.Add(_("&WebCam"));
m_TextTypeStrings.Add(_("&Slider"));
m_TextTypeStrings.Add(_("&Input"));
m_TextTypeStrings.Add(_("&Toggle"));
wxRadioBox* m_TextType = new wxRadioBox( this, -1, _("Type"), wxDefaultPosition, wxDefaultSize, m_TextTypeStrings, 2, wxRA_SPECIFY_COLS );
m_TextType->SetSelection(0);
sizer->Add(m_TextType, 0, wxALIGN_TOP|wxALL, 5);

SetSizer(sizer);


m_TextType->SetString( 0, wxT( "texttext" ) );

sizer->Layout();

GetSizer()->Fit(this);

#if wxUSE_STATUSBAR
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
SetStatusText("Welcome to wxWidgets!");
#endif // wxUSE_STATUSBAR
}

Screenshot.2025-09-25.at.15.16.55.png (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25831/3333995788@github.com>

rocrail

unread,
Sep 25, 2025, 9:44:01 AM (11 days ago) Sep 25
to wx-...@googlegroups.com, Subscribed
rocrail left a comment (wxWidgets/wxWidgets#25831)

If I comment out this line:

'''cpp
//GetSizer()->Fit(this);
'''

it looks like this:

Screenshot.2025-09-25.at.15.43.01.png (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25831/3334157884@github.com>

rocrail

unread,
Oct 3, 2025, 2:55:13 AM (3 days ago) Oct 3
to wx-...@googlegroups.com, Subscribed
rocrail left a comment (wxWidgets/wxWidgets#25831)

Also the call wxSizer::Layout() can cause this behavior.
This call is needed after setting the translations.

IMHO the minimal size of the RadioBox is not correct or disregarded.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25831/3364493487@github.com>

rocrail

unread,
Oct 3, 2025, 9:45:11 AM (3 days ago) Oct 3
to wx-...@googlegroups.com, Subscribed
rocrail left a comment (wxWidgets/wxWidgets#25831)

I found a work-around for this layout issue:
Put the RadioBox in a FlexSizer.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25831/3365739936@github.com>

Reply all
Reply to author
Forward
0 new messages