]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toolbar.cpp
applying OSAF patch for "toolbar selection not correct on Mac after calling Realize...
[wxWidgets.git] / src / mac / carbon / toolbar.cpp
index 1f5403adb325e52f006e96659575a19f39cd4b37..91d3f6f47fa633b99dc40d7a9aaeafc7cc9f6ebc 100644 (file)
@@ -436,6 +436,21 @@ bool wxToolBar::Realize()
                     DoToggleTool(tool, true);
                 }
             }
+            else if (tool->IsToggled())
+            {
+                wxToolBarToolsList::compatibility_iterator nodePrev = node->GetPrevious();
+                while ( nodePrev )
+                {
+                    wxToolBarToolBase *tool = nodePrev->GetData();
+                    if ( !tool->IsButton() || (tool->GetKind() != wxITEM_RADIO) )
+                        break;
+                    if ( tool->Toggle(false) )
+                    {
+                        DoToggleTool(tool, false);
+                    }
+                    nodePrev = nodePrev->GetPrevious();
+                }
+            }
             isRadio = TRUE;
         }
         else