changeset 840:2967934fb587

Implemented the fix for the scrollbox problem on the Mac (that was discovered on Windows)
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 29 Mar 2011 17:36:57 +0000
parents ccfa5173659f
children 9be19dbd2ff4
files mac/dw.m
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Tue Mar 29 17:21:50 2011 +0000
+++ b/mac/dw.m	Tue Mar 29 17:36:57 2011 +0000
@@ -699,14 +699,19 @@
 @interface DWScrollBox : NSScrollView
 {
     void *userdata;
+    id box;
 }
 -(void *)userdata;
 -(void)setUserdata:(void *)input;
+-(void)setBox:(void *)input;
+-(id)box;
 @end
 
 @implementation DWScrollBox
 -(void *)userdata { return userdata; }
 -(void)setUserdata:(void *)input { userdata = input; }
+-(void)setBox:(void *)input { box = input; }
+-(id)box { return box; }
 -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [super dealloc]; }
 @end
 
@@ -2620,11 +2625,14 @@
 {
     DWScrollBox *scrollbox = [[DWScrollBox alloc] init];
     DWBox *box = dw_box_new(type, pad);
+    DWBox *tmpbox = dw_box_new(DW_VERT, 0);
+    dw_box_pack_start(tmpbox, box, 1, 1, TRUE, TRUE, 0);
     [scrollbox setHasVerticalScroller:YES];
     [scrollbox setHasHorizontalScroller:YES];
     [scrollbox setBorderType:NSNoBorder];
     [scrollbox setDrawsBackground:NO];
-    [scrollbox setDocumentView:box];
+    [scrollbox setBox:box];
+    [scrollbox setDocumentView:tmpbox];
     return scrollbox;
 }
 
@@ -2686,7 +2694,7 @@
     else if([ object isMemberOfClass:[ DWScrollBox class ] ])
     {
         DWScrollBox *scrollbox = box;
-        view = [scrollbox documentView];
+        view = [scrollbox box];
     }
 
     thisbox = [view box];
@@ -2794,7 +2802,7 @@
     else if([ object isMemberOfClass:[ DWScrollBox class ] ])
     {
         DWScrollBox *scrollbox = box;
-        view = [scrollbox documentView];
+        view = [scrollbox box];
     }
 
     thisbox = [view box];