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.
tengai
Knows some wx things
Posts: 32 Joined: Fri May 11, 2018 6:49 pm
Post
by tengai » Tue Sep 18, 2018 6:29 pm
Hello,
I have the following code to set wxBU_EXACTFIT for my buttons;
Code: Select all
btnPomObject = new wxButton(this, ePOM_object_btn, "POM_object", wxDefaultPosition, wxDefaultSize, wxBU_TOP | wxBU_EXACTFIT);
I set wxBU_TOP just to show there is extra space to scale down.
button_wxBU_EXACTFIT.PNG (4.4 KiB) Viewed 546 times
If you look at the button image example (wxGTK Appearance) in the docs (
https://docs.wxwidgets.org/3.0/classwx_button.html ) it suggest sizing should be better.
Any suggestions?
Thanks.
doublemax
Moderator
Posts: 19115 Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2
Post
by doublemax » Tue Sep 18, 2018 6:34 pm
How did you create the GUI? Pure code or with a GUI editor?
Are there any sizers involved? It's possible that a sizer is overriding the size.
Use the source, Luke!
tengai
Knows some wx things
Posts: 32 Joined: Fri May 11, 2018 6:49 pm
Post
by tengai » Tue Sep 18, 2018 6:37 pm
The code is very basic:
Code: Select all
wxHierarchicalPanel::wxHierarchicalPanel(wxWindow *parent) : wxPanel(parent, wxID_ANY)
{
sizer = new wxStaticBoxSizer(wxHORIZONTAL, this, "Hierarchy");
btnSizer = new wxBoxSizer(wxHORIZONTAL);
btnPomObject = new wxButton(this, ePOM_object_btn, "POM_object", wxDefaultPosition, wxDefaultSize, wxBU_TOP | wxBU_EXACTFIT);
btnPomObject->SetClientObject(new wxButtonData(wxString("POM_object")));
btnPomObject->Enable(false);
btnPomObject->Show();
btnSizer->Add(btnPomObject);
sizer->Add(btnSizer);
SetSizer(sizer);
totalButtons = 1;
}