Mercurial > projects > dwt-mac
diff dwt/widgets/Display.d @ 8:a9ab4c738ed8
Fix: instanceof
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 14:32:39 +0200 |
parents | e831403a80a9 |
children | 5b53d338c709 |
line wrap: on
line diff
--- a/dwt/widgets/Display.d Wed Aug 27 14:30:35 2008 +0200 +++ b/dwt/widgets/Display.d Wed Aug 27 14:32:39 2008 +0200 @@ -769,7 +769,7 @@ int tag = OS.objc_msgSend(handle, OS.sel_tag); if (tag !is -1) { Object object = OS.JNIGetObject(tag); - if (object instanceof Widget) { + if ( null !is cast(Widget)object ) { return cast(Widget)object; } } @@ -869,7 +869,7 @@ int tag = OS.objc_msgSend(view.id, OS.sel_tag); if (tag !is -1) { Object object = OS.JNIGetObject(tag); - if (object instanceof Shell) { + if ( null !is cast(Shell)object ) { return cast(Shell)object; } } @@ -1119,7 +1119,7 @@ int tag = OS.objc_msgSend(view.id, OS.sel_tag); if (tag !is -1) { Object object = OS.JNIGetObject(tag); - if (object instanceof Control) { + if ( null !is cast(Control)object ) { //TODO go up hierarchy return cast(Control)object; } @@ -1138,7 +1138,7 @@ tag = OS.objc_msgSend(delegate.id, OS.sel_tag); if (tag !is 0 && tag !is -1) { Object object = OS.JNIGetObject(tag); - if (object instanceof Control) { + if ( null !is cast(Control)object ) { return cast(Control)object; } } @@ -1332,7 +1332,7 @@ int jniRef = OS.objc_msgSend(view.id, OS.sel_tag); if (jniRef !is 0 && jniRef !is -1) { Object object = OS.JNIGetObject(jniRef); - if (object instanceof Shell) { + if ( null !is cast(Shell)object ) { result[index++] = cast(Shell)object; } } @@ -3114,9 +3114,9 @@ dialog.changeFont(arg0); } else if (sel is OS.sel_windowWillClose_1) { Object object = OS.JNIGetObject(jniRef); - if (object instanceof FontDialog) { + if ( null !is cast(FontDialog)object ) { (cast(FontDialog)object).windowWillClose(arg0); - } else if (object instanceof ColorDialog) { + } else if ( null !is cast(ColorDialog)object ) { (cast(ColorDialog)object).windowWillClose(arg0); } }