ToggleC.st
changeset 125 3ffa271732f7
parent 120 710d41f17b68
child 126 40228f4fd66b
--- a/ToggleC.st	Mon May 08 17:19:27 1995 +0200
+++ b/ToggleC.st	Tue May 09 03:57:16 1995 +0200
@@ -35,7 +35,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg/Attic/ToggleC.st,v 1.4 1995-05-03 16:30:51 claus Exp $
+$Header: /cvs/stx/stx/libwidg/Attic/ToggleC.st,v 1.5 1995-05-09 01:56:56 claus Exp $
 "
 !
 
@@ -44,6 +44,12 @@
     ToggleControllers redefine some of ButtonControllers behavior;
     user interaction: they always triggerOnDown, and ignore buttonrelease.
     Finally, every buttonPress leads to a toggle action.
+
+    ToggleController redefines the actionBlock, since it inherits press-
+    and releaseActions, while we want one actionBlock to be used for both
+    on- and off. The actionBlock (if any) is evaluated with the current
+    toggles state if it expects an argument, or without argument if its a no-arg
+    block.
 "
 ! !
 
@@ -58,11 +64,13 @@
 
 performAction
     action notNil ifTrue:[
+	active := true.
 	action numArgs == 0 ifTrue:[
 	    action value
 	] ifFalse:[
 	    action value:pressed
 	].
+	active := false.
     ].
     super performAction
 ! !
@@ -75,4 +83,3 @@
 
     action := aBlock
 ! !
-