]> git.saurik.com Git - wxWidgets.git/commitdiff
use SendSizeEvent() to resize the button correctly after reparenting under MSW
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Aug 2002 17:04:06 +0000 (17:04 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Aug 2002 17:04:06 +0000 (17:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/minifram/minifram.cpp

index ebb4d138ba849423eea187c9f4bd71f4ba084e88..796773a8b7671a078fd5f99d8983e63a64cb6b1c 100644 (file)
@@ -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();
+  }
 }