]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toplevel.cpp
background drawing uncommented again
[wxWidgets.git] / src / mac / carbon / toplevel.cpp
index 6d038b6fa8de22c3e5b8060a831462c7b3e2995d..f527792360d273253bce768b564bc2c6ab9d2e92 100644 (file)
@@ -74,7 +74,7 @@ extern long wxMacTranslateKey(unsigned char key, unsigned char code) ;
 static const EventTypeSpec eventList[] =
 {
     // TODO remove control related event like key and mouse (except for WindowLeave events)
 static const EventTypeSpec eventList[] =
 {
     // TODO remove control related event like key and mouse (except for WindowLeave events)
-#if !TARGET_API_MAC_OSX    
+#if 1
     { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } ,
 
     { kEventClassKeyboard, kEventRawKeyDown } ,
     { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent } ,
 
     { kEventClassKeyboard, kEventRawKeyDown } ,
@@ -827,6 +827,16 @@ void  wxTopLevelWindowMac::MacSetBackgroundBrush( const wxBrush &brush )
     }
 }
 
     }
 }
 
+void wxTopLevelWindowMac::MacInstallTopLevelWindowEventHandler() 
+{
+    if ( m_macEventHandler != NULL )
+    {
+        verify_noerr( ::RemoveEventHandler( (EventHandlerRef) m_macEventHandler ) ) ;
+    }
+    InstallWindowEventHandler(MAC_WXHWND(m_macWindow), GetwxMacTopLevelEventHandlerUPP(),
+        GetEventTypeCount(eventList), eventList, this, (EventHandlerRef *)&m_macEventHandler);
+}
+
 void  wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
            const wxPoint& pos,
            const wxSize& size,
 void  wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
            const wxPoint& pos,
            const wxSize& size,
@@ -950,13 +960,12 @@ void  wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
     else
     {
         ::CreateRootControl( (WindowRef)m_macWindow , (ControlRef*)&m_macControl ) ;
     else
     {
         ::CreateRootControl( (WindowRef)m_macWindow , (ControlRef*)&m_macControl ) ;
-        MacInstallEventHandler() ;
     }
     }
+    MacInstallEventHandler() ;
 
     InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_macWindow)) ) ;
 
     InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_macWindow)) ) ;
-    InstallWindowEventHandler(MAC_WXHWND(m_macWindow), GetwxMacTopLevelEventHandlerUPP(),
-        GetEventTypeCount(eventList), eventList, this, (EventHandlerRef *)&m_macEventHandler);
-
+    MacInstallTopLevelWindowEventHandler() ;
+    
     m_macFocus = NULL ;
 
     if ( HasFlag(wxFRAME_SHAPED) )
     m_macFocus = NULL ;
 
     if ( HasFlag(wxFRAME_SHAPED) )