+ if ( tool->IsRadio() )
+ {
+ wxToolBarToolsList::compatibility_iterator node
+ = wxToolBarToolsList::compatibility_iterator();
+ if ( pos ) node = m_tools.Item(pos - 1);
+
+ while ( node )
+ {
+ wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
+ if ( !tool->IsRadio() )
+ break;
+
+ widget = tool->m_item;
+
+ node = node->GetPrevious();
+ }
+
+ if ( !widget )
+ {
+ // this is the first button in the radio button group,
+ // it will be toggled automatically by GTK so bring the
+ // internal flag in sync
+ tool->Toggle(TRUE);
+ }
+ }
+
+ tool->m_item = gtk_toolbar_insert_element
+ (
+ m_toolbar,
+ tool->GetGtkChildType(),
+ widget,
+ tool->GetLabel().empty()
+ ? NULL
+ : (const char*) wxGTK_CONV( tool->GetLabel() ),
+ tool->GetShortHelp().empty()
+ ? NULL
+ : (const char*) wxGTK_CONV( tool->GetShortHelp() ),
+ "", // tooltip_private_text (?)
+ tool->m_pixmap,
+ (GtkSignalFunc)gtk_toolbar_callback,
+ (gpointer)tool,
+ posGtk
+ );
+
+ if ( !tool->m_item )
+ {
+ wxFAIL_MSG( _T("gtk_toolbar_insert_element() failed") );
+
+ return FALSE;
+ }