changeset 808:c0641a6d4258

Similar fix for dw_window_get_text().
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 24 Mar 2011 15:46:51 +0000
parents f7016a38bedd
children 1ef0f4c03c14
files mac/dw.m
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Thu Mar 24 15:42:50 2011 +0000
+++ b/mac/dw.m	Thu Mar 24 15:46:51 2011 +0000
@@ -6388,20 +6388,20 @@
 {
     NSObject *object = handle;
 
-    if([ object isKindOfClass:[ NSControl class ] ])
+    if([ object isKindOfClass:[ NSWindow class ] ] || [ object isKindOfClass:[ NSButton class ] ])
+    {
+        id window = handle;
+        NSString *nsstr = [ window title];
+        
+        return strdup([ nsstr UTF8String ]);
+    }
+    else if([ object isKindOfClass:[ NSControl class ] ])
     {
         NSControl *control = handle;
         NSString *nsstr = [ control stringValue];
 
         return strdup([ nsstr UTF8String ]);
     }
-    else if([ object isKindOfClass:[ NSWindow class ] ])
-    {
-        NSWindow *window = handle;
-        NSString *nsstr = [ window title];
-
-        return strdup([ nsstr UTF8String ]);
-    }
     return NULL;
 }