Label.st
changeset 50 e2a1b5f187ef
parent 38 4b9b70b2cc87
child 59 450ce95a72a4
--- a/Label.st	Wed Aug 24 01:37:35 1994 +0200
+++ b/Label.st	Wed Aug 24 01:38:00 1994 +0200
@@ -25,7 +25,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
 
-$Header: /cvs/stx/stx/libwidg/Label.st,v 1.7 1994-08-07 13:22:44 claus Exp $
+$Header: /cvs/stx/stx/libwidg/Label.st,v 1.8 1994-08-23 23:38:00 claus Exp $
 '!
 
 !Label class methodsFor:'documentation'!
@@ -46,7 +46,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg/Label.st,v 1.7 1994-08-07 13:22:44 claus Exp $
+$Header: /cvs/stx/stx/libwidg/Label.st,v 1.8 1994-08-23 23:38:00 claus Exp $
 "
 !
 
@@ -96,6 +96,13 @@
         fixSize             <Boolean>       if true, a change of the logo change will not
                                             resize the label; otherwise, its size is adjusted.
                                             default:false.
+
+    Model-View behavior:
+        label model:aModel.
+        label aspect:aspectSymbol.
+
+        model sends #changed:aspectSymbol
+        ---> label will redraw its label from value of model>>aspectSymbol
 "
 ! !
 
@@ -267,6 +274,7 @@
         aForm ~~ logo ifTrue:[
             logo notNil ifTrue:[
                 logo extent = aForm extent ifTrue:[
+                    logo := aForm.
                     ^ self
                 ]
             ].
@@ -276,6 +284,20 @@
     ]
 ! !
 
+!Label methodsFor:'change & update'!
+
+update:something
+    "the MVC way of changing the label ..."
+
+    (something == aspectSymbol) ifTrue:[
+        model notNil ifTrue:[
+            self label:(model perform: aspectSymbol) printString.
+        ].
+        ^ self.
+    ].
+    super update:something
+! !
+
 !Label methodsFor:'queries'!
 
 preferredExtent