StandardSystemView.st
changeset 3408 42384f123133
parent 3393 a7f33744dd82
child 3435 3364a7082bdd
--- a/StandardSystemView.st	Mon Mar 19 10:13:00 2001 +0100
+++ b/StandardSystemView.st	Mon Apr 02 10:59:54 2001 +0200
@@ -14,7 +14,7 @@
 
 TopView subclass:#StandardSystemView
 	instanceVariableNames:'label icon iconView iconLabel minExtent maxExtent sizeFixed
-		application windowEventsForApplication deviceIcon'
+		application windowEventsForApplication deviceIcon labelChannel'
 	classVariableNames:'DefaultIcon IncludeHostNameInLabel DefaultExtent
 		WindowLabelFormat DefaultMinExtent'
 	poolDictionaries:''
@@ -539,6 +539,25 @@
     "Modified: 18.4.1996 / 14:55:44 / cg"
 ! !
 
+!StandardSystemView methodsFor:'accessing - channels'!
+
+labelChannel
+    "return the labelChannel - or nil"
+
+    ^ labelChannel.
+!
+
+labelChannel:aValueHolder
+    "set the labelChannel - a valueHolder holding a string
+     which is shown as title bar"
+
+    |prev|
+
+    prev := labelChannel.
+    labelChannel := aValueHolder.
+    self setupChannel:aValueHolder for:nil withOld:prev.
+! !
+
 !StandardSystemView methodsFor:'accessing-behavior'!
 
 bePartner
@@ -767,6 +786,7 @@
 iconName:aString
     "this method will vanish soon ... - for backward compatibility"
 
+    self obsoleteMethodWarning:'use #iconLabel:'.
     self iconLabel:aString
 !
 
@@ -829,12 +849,30 @@
     self iconLabel:iconLabelString
 ! !
 
+!StandardSystemView methodsFor:'change & update'!
+
+update:something with:aParameter from:changedObject
+    "the MVC way of changing the label ..."
+
+    changedObject notNil ifTrue:[
+        changedObject == labelChannel ifTrue:[
+            self label:labelChannel value.
+            ^ self
+        ].
+    ].
+    ^ super update:something with:aParameter from:changedObject
+! !
+
 !StandardSystemView methodsFor:'destroying'!
 
 destroy
     "destroy the view."
 
     self removeFromCurrentProject.
+    labelChannel notNil ifTrue:[
+        labelChannel removeDependent:self.
+        labelChannel := nil.
+    ].
     windowGroup notNil ifTrue:[
         windowGroup focusSequence:nil.
     ].
@@ -1427,28 +1465,20 @@
 recreate
     "recreate the view after a snap-in or a migration"
 
-    |i m|
-
     super recreate.
 
     iconView notNil ifTrue:[
-	iconView recreate.
-	device setWindowIconWindow:iconView in:drawableId.
-	iconView setRealized:true.
+        iconView recreate.
+        device setWindowIconWindow:iconView in:drawableId.
+        iconView setRealized:true.
     ] ifFalse:[
-	icon notNil ifTrue:[
-	    i := self convertedIcon:icon.
-	    (i notNil and:[i id notNil]) ifTrue:[
-		(m := icon mask) notNil ifTrue:[
-		    m := self convertedIconMask:m.
-		].
-		device setWindowIcon:i mask:m in:drawableId
-	    ]
-	].
+        icon notNil ifTrue:[
+            self icon:icon.
+        ].
     ].
 
     iconLabel notNil ifTrue:[
-	device setIconName:iconLabel in:drawableId
+        device setIconName:iconLabel in:drawableId
     ]
 
     "Modified: 4.4.1997 / 16:16:40 / cg"
@@ -1457,6 +1487,6 @@
 !StandardSystemView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.137 2000-12-21 13:07:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.138 2001-04-02 08:59:54 stefan Exp $'
 ! !
 StandardSystemView initialize!