--- a/View.st Mon Jan 17 11:37:53 2000 +0100
+++ b/View.st Mon Jan 17 12:09:09 2000 +0100
@@ -264,43 +264,26 @@
"Modified: / 30.3.1999 / 13:50:08 / stefan"
!
-setupChannel:newChannel for:changeSelector withOld:oldChannel
- "common code to change a channel.
- If changeSelector is non-nil, arrange for it to be sent when
- the channel changes its value; otherwise, arrange for a simple update.
- This is so common, that ist worth a helper method:
- release any old channel (if non-nil),
- arrange for changeSelector (or #update) to be sent for the new channel."
+setVisibilityChannel:aValueHolder
+ "set the valueHolder, which holds the visible boolean value"
- |oldValue|
+ visibilityChannel := aValueHolder.
- oldChannel == newChannel ifTrue:[^ self].
+ "
+ |v h|
- oldChannel notNil ifTrue:[
- changeSelector isNil ifTrue:[
- oldChannel removeDependent:self
- ] ifFalse:[
- oldChannel retractInterestsFor:self.
- ].
- oldValue := oldChannel value.
- ].
- newChannel notNil ifTrue:[
- changeSelector isNil ifTrue:[
- newChannel addDependent:self.
- newChannel value ~~ oldValue ifTrue:[
- self update:#value with:nil from:newChannel.
- ]
- ] ifFalse:[
- newChannel onChangeSend:changeSelector to:self.
- newChannel value ~~ oldValue ifTrue:[
- self perform:changeSelector.
- ]
- ]
- ].
+ v := View new.
+ v visibilityChannel:(h := ValueHolder with:true).
+ v open.
+ Delay waitForSeconds:2.
+ h value:false.
+ Delay waitForSeconds:2.
+ h value:true.
+ Delay waitForSeconds:2.
+ "
- ^ newChannel
-
- "Modified: / 31.10.1997 / 14:47:21 / cg"
+ "Created: / 14.1.1998 / 17:11:15 / stefan"
+ "Modified: / 14.1.1998 / 17:33:40 / stefan"
!
visibilityChannel
@@ -719,14 +702,6 @@
self enabled:(enableChannel value)
"Modified: / 30.3.1999 / 16:07:08 / stefan"
-!
-
-visibilityStateChanged
- "this is called when our visibilityChannel changes"
-
- self isVisible:(visibilityChannel value)
-
- "Modified: / 30.3.1999 / 16:09:14 / stefan"
! !
!View methodsFor:'focus handling'!
@@ -777,5 +752,5 @@
!View class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/View.st,v 1.67 1999-12-08 20:51:24 ca Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/View.st,v 1.68 2000-01-17 11:09:09 cg Exp $'
! !