class: MemoryMonitorView
authorStefan Vogel <sv@exept.de>
Tue, 18 Feb 2014 15:51:35 +0100
changeset 13957 f7064863060e
parent 13956 70b04e6814ba
child 13958 4a5434f80b62
class: MemoryMonitorView changed: #initialize #memoryMenu #realize #updateNumbers access device via message send
MemoryMonitorView.st
--- a/MemoryMonitorView.st	Tue Feb 18 15:39:34 2014 +0100
+++ b/MemoryMonitorView.st	Tue Feb 18 15:51:35 2014 +0100
@@ -356,9 +356,9 @@
 
     self paint:White on:Black.
 
-    fontDescent := font descent.
-    fontAscent := font ascent.
-    fontHeight := font height + fontDescent.
+    fontDescent := gc font descent.
+    fontAscent := gc font ascent.
+    fontHeight := gc font height + fontDescent.
     half := height // 2 + fontDescent.
 
     y := half - (fontHeight * 8).
@@ -622,8 +622,8 @@
 
     updateIndex := 1.
 
-    self font:((Font family:'courier' face:'medium' style:'roman' size:10) onDevice:device).
-    org := font widthOf:'max 99999k '.
+    self font:((Font family:'courier' face:'medium' style:'roman' size:10) onDevice:self device).
+    org := gc font widthOf:'max 99999k '.
     level := 0.
 
     maxTotal := minTotal := ObjectMemory oldSpaceSize 
@@ -632,7 +632,7 @@
 
     viewBackground := Black.
 
-    device hasColors ifTrue:[
+    self graphicsDevice hasColors ifTrue:[
         newColor := Color orange. "/ yellow.
         freeColor := Color green.
         mallocColor := Color yellow.
@@ -654,6 +654,8 @@
 !
 
 realize
+    |graphicsDevice|
+
     super realize.
     updateBlock notNil ifTrue:[
         Processor addTimedBlock:updateBlock afterSeconds:updateInterval.
@@ -675,10 +677,11 @@
         ].
     ].
 
-    newColor := newColor onDevice:device.
-    freeColor := freeColor onDevice:device.
-    oldColor := oldColor onDevice:device.
-    mallocColor := mallocColor onDevice:device.
+    graphicsDevice := self graphicsDevice.
+    newColor := newColor onDevice:graphicsDevice.
+    freeColor := freeColor onDevice:graphicsDevice.
+    oldColor := oldColor onDevice:graphicsDevice.
+    mallocColor := mallocColor onDevice:graphicsDevice.
 
     "Modified: / 23.9.1998 / 12:41:10 / cg"
 !
@@ -923,7 +926,7 @@
                             itemList:items
                             resources:resources.
 
-        device ctrlDown ifTrue:[
+        self sensor ctrlDown ifTrue:[
             ^ specialMenu
         ].
 
@@ -1043,10 +1046,10 @@
 !MemoryMonitorView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/MemoryMonitorView.st,v 1.21 2014-01-13 13:27:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/MemoryMonitorView.st,v 1.22 2014-02-18 14:51:35 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/MemoryMonitorView.st,v 1.21 2014-01-13 13:27:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/MemoryMonitorView.st,v 1.22 2014-02-18 14:51:35 stefan Exp $'
 ! !