RadioButtonGroup.st
author claus
Wed, 13 Oct 1993 03:49:56 +0100
changeset 5 7b4fb1b170e5
parent 3 9d7eefb5e69f
child 7 15a9291b9bd0
permissions -rw-r--r--
(none)

"
 COPYRIGHT (c) 1991 by Claus Gittinger
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

VariableArray subclass:#RadioButtonGroup
	 instanceVariableNames:'buttonGroup'
	 classVariableNames:''
	 poolDictionaries:''
	 category:'Views-Support'
!

RadioButtonGroup comment:'

COPYRIGHT (c) 1991 by Claus Gittinger
              All Rights Reserved

RadioButtonGroups controll the interaction between RadioButtons
turning off other button(s) when one of the group is pressed.

$Header: /cvs/stx/stx/libwidg/RadioButtonGroup.st,v 1.3 1993-10-13 02:48:51 claus Exp $
written nov 91 by claus
'!

!RadioButtonGroup methodsFor:'adding / removing'!

add:aRadioButton
    super add:aRadioButton.
    aRadioButton addDependent:self
! !

!RadioButtonGroup methodsFor:'update'!

update:changedButton
    "a RadioButton in this group has changed - notify the others"

    self do:[:aButton |
        (aButton == changedButton) ifFalse:[
            aButton isOn ifTrue:[
                aButton turnOff
            ]
        ]
    ]

! !