mirror of
https://github.com/sojamo/controlp5
synced 2024-11-22 14:07:55 +01:00
Fix RadioButton.removeItem(String)
This commit is contained in:
parent
8ade1d493b
commit
c3bdd53a3c
@ -138,13 +138,15 @@ public class RadioButton extends ControlGroup< RadioButton > {
|
||||
*/
|
||||
public RadioButton removeItem( final String theName ) {
|
||||
int n = _myRadioToggles.size( );
|
||||
for ( int i = 0 ; i < n ; i++ ) {
|
||||
for ( int i = n-1 ; i >= 0 ; i-- ) {
|
||||
if ( ( _myRadioToggles.get( i ) ).getName( ).equals( theName ) ) {
|
||||
( _myRadioToggles.get( i ) ).removeListener( this );
|
||||
_myRadioToggles.get( i ).remove();
|
||||
_myRadioToggles.remove( i );
|
||||
}
|
||||
}
|
||||
updateValues( false );
|
||||
updateLayout( );
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user