X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c503ab84377f297ce7f398bc654ab455f0079389..030c0beade81092da145abc94b2750cd11a3be0b:/src/mac/radiobut.cpp?ds=inline

diff --git a/src/mac/radiobut.cpp b/src/mac/radiobut.cpp
index c8530a88cd..99d51f705c 100644
--- a/src/mac/radiobut.cpp
+++ b/src/mac/radiobut.cpp
@@ -32,12 +32,12 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
 	
 	MacPreControlCreate( parent , id ,  label , pos , size ,style, validator , name , &bounds , title ) ;
 
-	m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , 1, 
+	m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1, 
 	  	kControlRadioButtonProc , (long) this ) ;
 	
 	MacPostControlCreate() ;
 
-  m_cycle = NULL ;
+  m_cycle = this ;
   
   if (HasFlag(wxRB_GROUP))
   {
@@ -67,9 +67,10 @@ void wxRadioButton::SetValue(bool val)
 {
 	int i;
 	wxRadioButton *cycle;
-	
+	  if ( GetControlValue( m_macControl ) == val )
+	    return ;
+	    
    ::SetControlValue( m_macControl , val ) ;
-   
    if (val) 
    {
    		cycle=this->NextInCycle();
@@ -80,6 +81,10 @@ void wxRadioButton::SetValue(bool val)
    				}
    			}
    		}
+    wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
+    event.SetEventObject(this);
+    event.SetInt( GetValue() );
+    ProcessCommand(event);
 }
 
 bool wxRadioButton::GetValue() const
@@ -95,11 +100,7 @@ void wxRadioButton::Command (wxCommandEvent & event)
 
 void wxRadioButton::MacHandleControlClick( ControlHandle control , SInt16 controlpart ) 
 {
-	SetValue(true) ;
-    wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
-    event.SetEventObject(this);
-    event.SetInt( GetValue() );
-    ProcessCommand(event);
+	  SetValue(true) ;
 }
 
 wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)