Hi,

When changing the background color of a NSTextView object after adding it 
to a NSScrollView (like, in Affiche), the color isn't set for the clipview 
so it'll remain white.

I've included with this mail a little patch for NSText.m. It will verify 
in -setBackgroundColor if the enclosingScrollView isn't nil and if it 
isn't, it'll set the color of the scrollview to the background color of 
the textview.

Thanks,
                Ludovic

-- 
Live as if you were to die tomorrow.
Learn as if you were to live forever.
 - Gandhi
--- /tmp/test/core/gui/Source/NSText.m  Wed Dec 20 12:00:31 2000
+++ NSText.m    Tue Dec  4 14:40:43 2001
@@ -57,6 +57,7 @@
 #include <AppKit/NSDragging.h>
 #include <AppKit/NSTextStorage.h>
 #include <AppKit/NSTextContainer.h>
+#include <AppKit/NSScrollView.h>
 #include <AppKit/NSLayoutManager.h>
 
 static Class   abstract;
@@ -208,7 +209,16 @@
 
 - (void) setBackgroundColor: (NSColor*)color
 {
+  NSScrollView *sv;
+
   ASSIGN (_background_color, color);
+
+  sv = [self enclosingScrollView];
+  
+  if (sv != nil)
+    {
+      [sv setBackgroundColor: color];
+    }
 }
 
 - (void) setDrawsBackground: (BOOL)flag

Reply via email to