From cfdfd14c59df06bd3b98e2f27e3deeac0212492e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 5 Jan 2024 03:03:55 +0100 Subject: [PATCH] Improve frame size in the listctrl sample Make it bigger on high DPI displays and smaller on normal ones. --- samples/listctrl/listtest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 9f1af0b595..e08687d867 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -170,7 +170,7 @@ wxEND_EVENT_TABLE() // My frame constructor MyFrame::MyFrame(const wxString& title) - : wxFrame(nullptr, wxID_ANY, title, wxDefaultPosition, wxSize(600, 500)) + : wxFrame(nullptr, wxID_ANY, title) { m_listCtrl = nullptr; m_logWindow = nullptr; @@ -293,6 +293,9 @@ MyFrame::MyFrame(const wxString& title) RecreateList(wxLC_REPORT | wxLC_SINGLE_SEL); + // Make the list control big enough to show its initial contents. + m_listCtrl->SetInitialSize(FromDIP(wxSize(600, 300))); + #ifdef __WXMSW__ // this is useful to know specially when debugging :) wxLogMessage("Your version of comctl32.dll is: %d",