From 70ccec2e829e1eb947f88c4df8008366bb0f42d8 Mon Sep 17 00:00:00 2001 From: Antoine Mercadal Date: Mon, 10 Oct 2011 14:49:59 +0200 Subject: [PATCH] do not send action when using setState: programatically --- AppKit/CPRadio.j | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/AppKit/CPRadio.j b/AppKit/CPRadio.j index e38f8aeff..85b4585c5 100644 --- a/AppKit/CPRadio.j +++ b/AppKit/CPRadio.j @@ -150,6 +150,14 @@ CPRadioImageOffset = 4.0; [_radioGroup _setSelectedRadio:self]; } +- (void)sendAction:(SEL)anAction to:(id)anObject +{ + [super sendAction:anAction to:anObject]; + + if (_radioGroup) + [CPApp sendAction:[_radioGroup action] to:[_radioGroup target] from:_radioGroup]; +} + @end var CPRadioRadioGroupKey = @"CPRadioRadioGroupKey"; @@ -220,8 +228,6 @@ var CPRadioRadioGroupKey = @"CPRadioRadioGroupKey"; [_selectedRadio setState:CPOffState]; _selectedRadio = aRadio; - - [CPApp sendAction:_action to:_target from:self]; } - (CPRadio)selectedRadio