wxBU_EXACTFIT in wxGTK doesn't seem to work.

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
tengai
Knows some wx things
Knows some wx things
Posts: 32
Joined: Fri May 11, 2018 6:49 pm

wxBU_EXACTFIT in wxGTK doesn't seem to work.

Post by tengai »

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
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.
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxBU_EXACTFIT in wxGTK doesn't seem to work.

Post by doublemax »

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
Knows some wx things
Posts: 32
Joined: Fri May 11, 2018 6:49 pm

Re: wxBU_EXACTFIT in wxGTK doesn't seem to work.

Post by tengai »

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;
 }
Post Reply