Issues with wxStaticBoxSizer (GTK build on KDE) Topic is solved
Issues with wxStaticBoxSizer (GTK build on KDE)
I've run into an odd issue related to the usage of wxStaticBoxSizer's in a GTK build running on Linux Mint 17.3 KDE 64 bit. The first attached image shows a dialog using the sizer as it looks when opened. As you can see the header of the static box is a bit squashed. The dialog can be resized and if I drag ever so little to resize the width of the dialog the static boxes expands to the expected size - but now the button in the bottom is squashed, as you can se in image 2. I have attached the source code for the dialog.
wxWidgets 3.0.2 has been configured with "--enable-unicode --disable-shared --with-libpng" and build with "SHARED=0 BUILD=release". Is this a known issue? Any workaround?
EDIT: Sorry, unable to add image 2..
wxWidgets 3.0.2 has been configured with "--enable-unicode --disable-shared --with-libpng" and build with "SHARED=0 BUILD=release". Is this a known issue? Any workaround?
EDIT: Sorry, unable to add image 2..
- Attachments
-
- wxwidgets_gtk2_1.png (8.69 KiB) Viewed 3278 times
-
- TestDialog.h
- (699 Bytes) Downloaded 93 times
-
- TestDialog.cpp
- (2.03 KiB) Downloaded 102 times
Last edited by DenDev on Thu Sep 08, 2016 12:08 pm, edited 2 times in total.
I have a bad habbit of not testing the code I post
Re: Issues with wxStaticBoxSizer (GTK build on KDE)
Trying to add image 2..
- Attachments
-
- wxwidgets_gtk2_2.png (8.83 KiB) Viewed 3274 times
I have a bad habbit of not testing the code I post
Re: Issues with wxStaticBoxSizer (GTK build on KDE)
Did you create the controls as children of the wxStaticBox?
Use the source, Luke!
Re: Issues with wxStaticBoxSizer (GTK build on KDE)
It is created using Code::Blocks / wxSmith, copied from TestDialog.cpp:
EDIT: I have tried to use "StaticBoxSizer*->GetStaticBox()" as parent for the TextCtrl's but that made it worse..
Code: Select all
wxStaticBoxSizer* StaticBoxSizer2;
wxFlexGridSizer* FlexGridSizer1;
wxBoxSizer* BoxSizer1;
wxStaticBoxSizer* StaticBoxSizer1;
Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("id"));
FlexGridSizer1 = new wxFlexGridSizer(3, 1, 0, 0);
FlexGridSizer1->AddGrowableRow(0);
FlexGridSizer1->AddGrowableRow(1);
StaticBoxSizer1 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Label"));
TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
StaticBoxSizer1->Add(TextCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer1->Add(StaticBoxSizer1, 1, wxALL|wxEXPAND, 5);
StaticBoxSizer2 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Label"));
TextCtrl2 = new wxTextCtrl(this, ID_TEXTCTRL2, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));
StaticBoxSizer2->Add(TextCtrl2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer1->Add(StaticBoxSizer2, 1, wxALL|wxEXPAND, 5);
BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
Button1 = new wxButton(this, ID_BUTTON1, _("Label"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
BoxSizer1->Add(Button1, 1, wxALL|wxEXPAND, 5);
FlexGridSizer1->Add(BoxSizer1, 1, wxALL|wxEXPAND, 5);
SetSizer(FlexGridSizer1);
FlexGridSizer1->Fit(this);
FlexGridSizer1->SetSizeHints(this);
I have a bad habbit of not testing the code I post
Re: Issues with wxStaticBoxSizer (GTK build on KDE)
You didn't mention the wxFlexGridSizer before. Can you try to strip the sample down to the absolute mininum to reproduce the issue?
Use the source, Luke!
Re: Issues with wxStaticBoxSizer (GTK build on KDE)
Can't make it any lesser than the attached Code::Blocks project.
- Attachments
-
- TestGUI.zip
- (6.9 KiB) Downloaded 85 times
I have a bad habbit of not testing the code I post
Re: Issues with wxStaticBoxSizer (GTK build on KDE)
As expected: Works fine for me under Windows.
Are you using GTK3? Maybe it's related to this bug: viewtopic.php?f=23&t=42515
Are you using GTK3? Maybe it's related to this bug: viewtopic.php?f=23&t=42515
Use the source, Luke!
Re: Issues with wxStaticBoxSizer (GTK build on KDE)
It has nothing to do with Windows, so of course the issue is not present there. I'm using a default GTK2 build on Linux Mint 17.3 KDE. I've tried to test the sample application on another computer running Debian Jessie with the same KDE desktop installed. The problem was not present there but the application looked totally different. This issue might be related to GTK being styled under KDE with something like QGtkStyle or QGnomePlatform.
Just such a weird annoyance!
Just such a weird annoyance!
I have a bad habbit of not testing the code I post
Re: Issues with wxStaticBoxSizer (GTK build on KDE)
Sizer code is generic, so if the problem was in there, it would be visible under Windows. Maybe it's the font size calculation under GTK(3) like in the other thread i linked.It has nothing to do with Windows, so of course the issue is not present there.
Use the source, Luke!
Re: Issues with wxStaticBoxSizer (GTK build on KDE)
A static box is not generic, it is a different control on Windows and OSX and Linux. The wxStaticBoxSizer is a sizer utilizing a static box control. The issue might be related to bad font size calculation - but since my build of wx is GTK2 I do not think it is related to GTK3. I think the issue is related to KDE's styling of GTK in order to make GTK applications look like Qt applications even if they are not.
I have a bad habbit of not testing the code I post
Re: Issues with wxStaticBoxSizer (GTK build on KDE)
Hi, DenDev,
It is possible that KDE uses a GTK theme that is broken on Linux Mint.
I vaguely remember that there was a "not so recent" post to wx-dev/wx-user about theme issue on Linux Mint specifically.
Can you try to change a theme of the KDE and try again?
Thank you.
It is possible that KDE uses a GTK theme that is broken on Linux Mint.
I vaguely remember that there was a "not so recent" post to wx-dev/wx-user about theme issue on Linux Mint specifically.
Can you try to change a theme of the KDE and try again?
Thank you.
Re: Issues with wxStaticBoxSizer (GTK build on KDE)
Bulls eye! The "oxygen-gtk" theme was the culprit, switching to another theme removed the issue. Sad though, oxygen theme looks the nicest, but..ONEEYEMAN wrote:Hi, DenDev,
It is possible that KDE uses a GTK theme that is broken on Linux Mint.
I vaguely remember that there was a "not so recent" post to wx-dev/wx-user about theme issue on Linux Mint specifically.
Can you try to change a theme of the KDE and try again?
Thank you.
I have a bad habbit of not testing the code I post