]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/menu.cpp
Minor improvement.
[wxWidgets.git] / src / gtk / menu.cpp
index a267b1bab811eef8fb74f0deeed0bb1c7fa5e0b1..d8f8db5bdd7e345d0b00bb9f632979d5c804f536 100644 (file)
@@ -184,9 +184,11 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
 {
     m_menus.Append( menu );
     
+    const wxChar *pc;
+    
     /* GTK 1.2 wants to have "_" instead of "&" for accelerators */
     wxString str;
-    for ( const wxChar *pc = title; *pc != _T('\0'); pc++ )
+    for ( pc = title; *pc != _T('\0'); pc++ )
     {
         if (*pc == _T('&'))
        {
@@ -218,15 +220,19 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
     entry.accelerator = (gchar*) NULL;
     entry.callback = (GtkItemFactoryCallback) NULL;
     entry.callback_action = 0;
-    entry.item_type = (m_style & wxMB_TEAROFF || menu->GetStyle() &
-                       wxMENU_TEAROFF) ?
-       "<Tearoff>" : "<Branch>";
+    
+/*
+    if ((m_style & wxMB_TEAROFF) || (menu->GetStyle() & wxMENU_TEAROFF)) 
+        entry.item_type = "<Tearoff>";
+    else
+*/
+        entry.item_type = "<Branch>";
     
     gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );  /* what is 2 ? */
     
     /* in order to get the pointer to the item we need the item text _without_ underscores */
     wxString tmp = _T("<main>/");
-    for ( const wxChar *pc = str; *pc != _T('\0'); pc++ )
+    for ( pc = str; *pc != _T('\0'); pc++ )
     {
         if (*pc == _T('_')) pc++; /* skip it */
         tmp << *pc;
@@ -236,6 +242,16 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title )
     
     gtk_menu_item_set_submenu( GTK_MENU_ITEM(menu->m_owner), menu->m_menu );
     
+/*
+    if ((m_style & wxMB_TEAROFF) || (menu->GetStyle() & wxMENU_TEAROFF)) 
+    {
+        entry.item_type = "<Tearoff>";
+       tmp.Remove( 0, 6 );
+       tmp.Append( _T("/tearoff") );
+        strcpy( buf, tmp.mb_str() );
+        gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );
+    }
+*/
 #else
 
     menu->m_owner = gtk_menu_item_new_with_label( str.mb_str() );
@@ -845,7 +861,13 @@ void wxMenu::Append( int id, const wxString &item, wxMenu *subMenu, const wxStri
     entry.path = buf;
     entry.callback = (GtkItemFactoryCallback) 0;
     entry.callback_action = 0;
-    entry.item_type = (m_style & wxMENU_TEAROFF) ? "<Tearoff>" : "<Branch>";
+    
+/*
+    if (m_style & wxMENU_TEAROFF)
+        entry.item_type = "<Tearoff>";
+    else
+*/
+        entry.item_type = "<Branch>";
     
     gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 );  /* what is 2 ? */