]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/menu.cpp
wxGridCellRenderer/Editor made ref counted
[wxWidgets.git] / src / gtk1 / menu.cpp
index 094b02165a437dc68fee78413ecabe395aaad247..8f5de087be54578caeb7dacd07870c87c73a32d6 100644 (file)
@@ -78,6 +78,8 @@ wxMenuBar::wxMenuBar( long style )
     }
 
     PostCreation();
+    
+    ApplyWidgetStyle();
 }
 
 wxMenuBar::wxMenuBar()
@@ -108,6 +110,8 @@ wxMenuBar::wxMenuBar()
     m_widget = GTK_WIDGET(m_menubar);
 
     PostCreation();
+    
+    ApplyWidgetStyle();
 }
 
 wxMenuBar::~wxMenuBar()
@@ -348,8 +352,11 @@ wxMenu *wxMenuBar::Remove(size_t pos)
         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.
@@ -358,8 +365,10 @@ wxMenu *wxMenuBar::Remove(size_t pos)
     
     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;
 }
@@ -621,11 +630,12 @@ wxMenuItem::~wxMenuItem()
 }
 
 // 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('_') )
         {
@@ -636,7 +646,7 @@ wxString wxMenuItem::GetLabel() const
         label += *pc;
     }
 #else // GTK+ 1.0
-    label = m_text;
+    label = text;
 #endif // GTK+ 1.2/1.0
 
     return label;
@@ -951,9 +961,9 @@ bool wxMenu::DoInsert(size_t pos, wxMenuItem *item)
 #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)