]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/dynamic/dynamic.cpp
Added Ryan Norton and myself to the list of contributors
[wxWidgets.git] / samples / dynamic / dynamic.cpp
index 378f6e1882f95bfe347ef53ca399bf6f71d88af3..6e803e0eba5acdeba10cb5844280a535b5da2409 100644 (file)
@@ -10,8 +10,8 @@
 /////////////////////////////////////////////////////////////////////////////
 
 #if defined(__GNUG__) && !defined(__APPLE__)
-#pragma implementation "dynamic.cpp"
-#pragma interface "dynamic.cpp"
+#pragma implementation
+#pragma interface
 #endif
 
 // For compilers that support precompilation, includes "wx/wx.h".
@@ -25,7 +25,7 @@
 #include "wx/wx.h"
 #endif
 
-#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__)
+#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXCOCOA__)
 #include "mondrian.xpm"
 #endif
 
@@ -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__