Buggy code:
} else if ( sel == ( OS . sel_keyUp_ ) ) { widget . keyUp ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_flagsChanged_ ) ) { widget . flagsChanged ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_mouseUp_ ) ) { widget . mouseUp ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_rightMouseDown_ ) ) { widget . rightMouseDown ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_rightMouseUp_ ) ) { widget . rightMouseUp ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_otherMouseDown_ ) ) { widget . otherMouseDown ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_otherMouseUp_ ) ) { widget . otherMouseUp ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_mouseMoved_ ) ) { widget . mouseMoved ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_mouseDragged_ ) ) { widget . mouseDragged ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_mouseEntered_ ) ) { widget . mouseEntered ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_mouseExited_ ) ) { widget . mouseExited ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_menuForEvent_ ) ) { return widget . menuForEvent ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_numberOfRowsInTableView_ ) ) { return widget . numberOfRowsInTableView ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_comboBoxSelectionDidChange_ ) ) { widget . comboBoxSelectionDidChange ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_tableViewSelectionDidChange_ ) ) { widget . tableViewSelectionDidChange ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_windowDidResignKey_ ) ) { widget . windowDidResignKey ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_windowDidBecomeKey_ ) ) { widget . windowDidBecomeKey ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_windowDidResize_ ) ) { widget . windowDidResize ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_windowDidMove_ ) ) { widget . windowDidMove ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_menuWillOpen_ ) ) { widget . menuWillOpen ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_menuDidClose_ ) ) { widget . menuDidClose ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_menuNeedsUpdate_ ) ) { widget . menuNeedsUpdate ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_outlineViewSelectionDidChange_ ) ) { widget . outlineViewSelectionDidChange ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_sendEvent_ ) ) { widget . windowSendEvent ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_helpRequested_ ) ) { widget . helpRequested ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_scrollWheel_ ) ) { widget . scrollWheel ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_pageDown_ ) ) { widget . pageDown ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_pageUp_ ) ) { widget . pageUp ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_textViewDidChangeSelection_ ) ) { widget . textViewDidChangeSelection ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_textDidChange_ ) ) { widget . textDidChange ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_attributedSubstringFromRange_ ) ) { return widget . attributedSubstringFromRange ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_characterIndexForPoint_ ) ) { return widget . characterIndexForPoint ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_firstRectForCharacterRange_ ) ) { NSRect rect = widget . firstRectForCharacterRange ( id , sel , arg0 ) ; int result = OS . malloc ( sizeof ) ; OS . memmove ( result , rect , sizeof ) ; return result ; } else if ( sel == ( OS . sel_insertText_ ) ) { widget . insertText ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_doCommandBySelector_ ) ) { widget . doCommandBySelector ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_highlightSelectionInClipRect_ ) ) { widget . highlightSelectionInClipRect ( id , sel , arg0 ) ; } else if ( sel == ( OS . sel_reflectScrolledClipView_ ) ) { <START_BUG> widget . reflectScrolledClipView ( arg0 ) ; <END_BUG> } return 0 ; } static int windowDelegateProc ( int id , int sel , int arg0 , int arg1 ) { } static int windowDelegateProc ( int id , int sel , int arg0 , int arg1 , int arg2 ) { } static int windowDelegateProc ( int id , int sel , int arg0 , int arg1 , int arg2 , int arg3 ) { } }

Fix:
widget . reflectScrolledClipView ( id , sel , arg0 ) ;