1--- src/osx/cocoa/textctrl.mm	2009-09-04 06:53:00.000000000 +0200
2+++ src/osx/cocoa/textctrl.mm	2009-10-18 20:47:57.000000000 +0200
3@@ -141,7 +141,7 @@
4
5 - (void) keyDown:(NSEvent*) event
6 {
7-    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( [self delegate] );
8+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( (WXWidget) [self delegate] );
9     lastKeyDownEvent = event;
10     if ( impl == NULL || !impl->DoHandleKeyEvent(event) )
11         [super keyDown:event];
12@@ -150,14 +150,14 @@
13
14 - (void) keyUp:(NSEvent*) event
15 {
16-    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( [self delegate] );
17+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( (WXWidget) [self delegate] );
18     if ( impl == NULL || !impl->DoHandleKeyEvent(event) )
19         [super keyUp:event];
20 }
21
22 - (void) flagsChanged:(NSEvent*) event
23 {
24-    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( [self delegate] );
25+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( (WXWidget) [self delegate] );
26     if ( impl == NULL || !impl->DoHandleKeyEvent(event) )
27         [super flagsChanged:event];
28 }
29@@ -170,7 +170,7 @@
30
31 - (void) insertText:(id) str
32 {
33-    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( [self delegate] );
34+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( (WXWidget) [self delegate] );
35     if ( impl == NULL || lastKeyDownEvent==nil || !impl->DoHandleCharEvent(lastKeyDownEvent, str) )
36     {
37         [super insertText:str];
38@@ -318,7 +318,7 @@
39
40     [m_scrollView setDocumentView: tv];
41
42-    [tv setDelegate: w];
43+    [tv setDelegate: (WXWidget) w];
44
45     InstallEventHandler(tv);
46 }
47@@ -433,7 +433,7 @@
48 wxNSTextFieldControl::wxNSTextFieldControl( wxTextCtrl *wxPeer, WXWidget w ) : wxWidgetCocoaImpl(wxPeer, w)
49 {
50     m_textField = (NSTextField*) w;
51-    [m_textField setDelegate: w];
52+    [m_textField setDelegate: (WXWidget) w];
53     m_selStart = m_selEnd = 0;
54     m_hasEditor = [w isKindOfClass:[NSTextField class]];
55 }
56