]> git.saurik.com Git - wxWidgets.git/commitdiff
Use the new event handler macros
authorRyan Norton <wxprojects@comcast.net>
Tue, 15 Feb 2005 01:20:27 +0000 (01:20 +0000)
committerRyan Norton <wxprojects@comcast.net>
Tue, 15 Feb 2005 01:20:27 +0000 (01:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32053 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/dynamic/dynamic.cpp

index 5e66beef8e4c65acbe33904f26116d563dfb361d..55b3b400a7e17bba422ef17a81ebe9364d7af4cf 100644 (file)
@@ -59,12 +59,11 @@ bool MyApp::OnInit(void)
   // Create the main frame window
   MyFrame *frame = new MyFrame(NULL, _T("Dynamic wxWidgets App"), 50, 50, 450, 340);
 
-  frame->Connect( DYNAMIC_QUIT,  wxID_ANY, wxEVT_COMMAND_MENU_SELECTED,
-                  (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
-                  &MyFrame::OnQuit );
-  frame->Connect( DYNAMIC_ABOUT, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED,
-                  (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
-                  &MyFrame::OnAbout );
+  // You used to have to do some casting for param 4, but now there are type-safe handlers
+  frame->Connect( DYNAMIC_QUIT,  wxID_ANY, 
+                    wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnQuit) );
+  frame->Connect( DYNAMIC_ABOUT, wxID_ANY, 
+                    wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnAbout) );
 
   // Give it an icon
 #ifdef __WXMSW__