From: Vadim Zeitlin Date: Thu, 22 Aug 2002 17:04:06 +0000 (+0000) Subject: use SendSizeEvent() to resize the button correctly after reparenting under MSW X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/33c8cf5e8c5ddda2ca56732f8c36223312c425e7 use SendSizeEvent() to resize the button correctly after reparenting under MSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/minifram/minifram.cpp b/samples/minifram/minifram.cpp index ebb4d138ba..796773a8b7 100644 --- a/samples/minifram/minifram.cpp +++ b/samples/minifram/minifram.cpp @@ -155,6 +155,9 @@ void MyMiniFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) void MyMiniFrame::OnReparent(wxCommandEvent& WXUNUSED(event)) { button->Reparent( main_frame ); + + // we need to force the frame to size its (new) child correctly + main_frame->SendSizeEvent(); } // MyMainFrame @@ -185,7 +188,12 @@ void MyMainFrame::OnReparent(wxCommandEvent& WXUNUSED(event)) "You don't want to make this button an orphan, do you?", "You got to be kidding"); else + { button->Reparent( mini_frame ); + + // same as above + mini_frame->SendSizeEvent(); + } }