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.
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.
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.
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.
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.
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
}
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
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.
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.
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.