ColorMenu.st
changeset 2184 16d3b72ca431
parent 2183 5c69691590eb
child 2186 05b16a66bb3d
--- a/ColorMenu.st	Thu Sep 12 15:32:18 2002 +0200
+++ b/ColorMenu.st	Thu Sep 12 15:39:15 2002 +0200
@@ -227,21 +227,18 @@
 
     |holder label|
 
-    aColor isColor 
-    ifFalse:
-    [
+    aColor isColor ifFalse:[
         enabledChannel value:false
-    ] 
-    ifTrue:
-    [
-        self disabledRedrawDo:
-        [                 
-            holder := self colorHolder.     
-            label  := Text string: '   ' emphasis:(#backgroundColor->aColor).
-            enabledChannel value:true.
-            holder label:label.
-            model value: aColor
-        ]
+    ] ifTrue:[
+        self 
+            disabledRedrawDo:
+                [                 
+                    holder := self colorHolder.     
+                    label  := Text string: '   ' emphasis:(#backgroundColor->aColor).
+                    enabledChannel value:true.
+                    holder label:label.
+                    model value: aColor
+                ]
     ]
 !
 
@@ -255,23 +252,12 @@
 
 !ColorMenu methodsFor:'accessing-channels'!
 
-model
-    "get my color channel"
-
-    ^model
-
-
-
-!
-
 model:aValueHolder
     "set my color channel"
 
-    model notNil ifTrue:[model removeDependent:self].
-    model := aValueHolder.
+    super model:aValueHolder.
     model notNil ifTrue:[
-        model addDependent:self.
-        self color: model value
+        self updateFomModel
     ]
 ! !
 
@@ -286,15 +272,8 @@
 
 !ColorMenu methodsFor:'change & update'!
 
-update:something with:aParameter from:changedObject
-    "one of my models changed its value"
-
-    changedObject == model ifTrue:[^self color: model value].
-    super update:something with:aParameter from:changedObject
-
-
-
-
+updateFomModel
+    self color:(model value)
 ! !
 
 !ColorMenu methodsFor:'initialization'!
@@ -913,5 +892,5 @@
 !ColorMenu class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/ColorMenu.st,v 1.28 2002-09-12 13:32:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ColorMenu.st,v 1.29 2002-09-12 13:39:13 cg Exp $'
 ! !