}
PostCreation();
-
+
ApplyWidgetStyle();
}
m_widget = GTK_WIDGET(m_menubar);
PostCreation();
-
+
ApplyWidgetStyle();
}
if ( !menu )
return (wxMenu*) NULL;
+/*
GtkMenuShell *menu_shell = GTK_MENU_SHELL(m_factory->widget);
+
printf( "factory entries before %d\n", (int)g_slist_length(m_factory->items) );
printf( "menu shell entries before %d\n", (int)g_list_length( menu_shell->children ) );
-
+*/
+
// unparent calls unref() and that would delete the widget so we raise
// the ref count to 2 artificially before invoking unparent.
gtk_widget_ref( menu->m_menu );
gtk_widget_unparent( menu->m_menu );
-
+
gtk_widget_destroy( menu->m_owner );
-
+
+/*
printf( "factory entries after %d\n", (int)g_slist_length(m_factory->items) );
printf( "menu shell entries after %d\n", (int)g_list_length( menu_shell->children ) );
-
+*/
+
return menu;
}
static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
{
if (g_isIdle) wxapp_install_idle_handler();
-
+
int id = menu->FindMenuIdByMenuItem(widget);
/* should find it for normal (not popup) menu */
}
// return the menu item text without any menu accels
-wxString wxMenuItem::GetLabel() const
+/* static */
+wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
{
wxString label;
#if (GTK_MINOR_VERSION > 0)
- for ( const wxChar *pc = m_text.c_str(); *pc; pc++ )
+ for ( const wxChar *pc = text.c_str(); *pc; pc++ )
{
if ( *pc == wxT('_') )
{
label += *pc;
}
#else // GTK+ 1.0
- label = m_text;
+ label = text;
#endif // GTK+ 1.2/1.0
return label;
#else // GTK < 1.2
// this should be easy to do...
wxFAIL_MSG( wxT("not implemented") );
-#endif // GTK 1.2/1.0
return FALSE;
+#endif // GTK 1.2/1.0
}
wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)