From 61f136700c8fa2e367d831577a783caa21e8b7c1 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 11 Feb 2016 11:32:57 +0100 Subject: [PATCH] Add an about button to the minimal sample for systems without menus. On minimal ports like wxIOS no menus are available. Providing an about button allows at least a minimal user interaction in that case. --- samples/minimal/minimal.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/samples/minimal/minimal.cpp b/samples/minimal/minimal.cpp index 27aabd76d7..b9599a18ea 100644 --- a/samples/minimal/minimal.cpp +++ b/samples/minimal/minimal.cpp @@ -164,6 +164,12 @@ MyFrame::MyFrame(const wxString& title) // ... and attach this menu bar to the frame SetMenuBar(menuBar); +#else + // 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()); #endif // wxUSE_MENUS #if wxUSE_STATUSBAR