fetch device resources early
authorClaus Gittinger <cg@exept.de>
Tue, 14 Jan 1997 00:12:53 +0100
changeset 940 e53f681448f0
parent 939 adf84728ccb3
child 941 f06fa4d47f26
fetch device resources early
ListView.st
--- a/ListView.st	Tue Jan 14 00:09:24 1997 +0100
+++ b/ListView.st	Tue Jan 14 00:12:53 1997 +0100
@@ -1391,6 +1391,17 @@
     ^ super defaultControllerClass
 !
 
+fetchDeviceResources
+    "fetch device colors, to avoid reallocation at redraw time"
+
+    super fetchDeviceResources.
+
+    fgColor notNil ifTrue:[fgColor := fgColor on:device].
+    bgColor notNil ifTrue:[bgColor := bgColor on:device].
+
+    "Created: 14.1.1997 / 00:12:12 / cg"
+!
+
 initStyle
     super initStyle.
 
@@ -1400,8 +1411,10 @@
     self leftMargin:(self horizontalPixelPerMillimeter:0.5) rounded.
 
     lineSpacing := 0.
-    fgColor := DefaultForegroundColor on:device.
-    bgColor := DefaultBackgroundColor on:device.
+    fgColor := DefaultForegroundColor.
+    bgColor := DefaultBackgroundColor.
+
+    "Modified: 14.1.1997 / 00:12:19 / cg"
 !
 
 initialize
@@ -3474,5 +3487,5 @@
 !ListView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.115 1997-01-07 19:33:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.116 1997-01-13 23:12:53 cg Exp $'
 ! !