+ if (id == m_menuId)
+ {
+ if (it)
+ *it = (wxMenuItem*) NULL;
+ return m_buttonWidget;
+ }
+
+ for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxMenuItem *item = node->GetData ();
+ if (item->GetId() == id)
+ {
+ if (it)
+ *it = item;
+ return item->GetButtonWidget();
+ }
+
+ if (item->GetSubMenu())
+ {
+ WXWidget w = item->GetSubMenu()->FindMenuItem (id, it);
+ if (w)
+ {
+ return w;
+ }
+ }
+ }
+
+ if (it)
+ *it = (wxMenuItem*) NULL;
+ return (WXWidget) NULL;
+}
+
+void wxMenu::SetBackgroundColour(const wxColour& col)
+{
+ m_backgroundColour = col;
+ if (m_menuWidget)
+ wxDoChangeBackgroundColour(m_menuWidget, (wxColour&) col);
+ if (m_buttonWidget)
+ wxDoChangeBackgroundColour(m_buttonWidget, (wxColour&) col, TRUE);
+
+ for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxMenuItem* item = node->GetData();
+ if (item->GetButtonWidget())
+ {
+ // This crashes because it uses gadgets
+ // wxDoChangeBackgroundColour(item->GetButtonWidget(), (wxColour&) col, TRUE);
+ }
+ if (item->GetSubMenu())
+ item->GetSubMenu()->SetBackgroundColour((wxColour&) col);
+ }
+}
+
+void wxMenu::SetForegroundColour(const wxColour& col)
+{
+ m_foregroundColour = col;
+ if (m_menuWidget)
+ wxDoChangeForegroundColour(m_menuWidget, (wxColour&) col);
+ if (m_buttonWidget)
+ wxDoChangeForegroundColour(m_buttonWidget, (wxColour&) col);
+
+ for ( wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxMenuItem* item = node->GetData();
+ if (item->GetButtonWidget())
+ {
+ // This crashes because it uses gadgets
+ // wxDoChangeForegroundColour(item->GetButtonWidget(), (wxColour&) col);
+ }
+ if (item->GetSubMenu())
+ item->GetSubMenu()->SetForegroundColour((wxColour&) col);
+ }
+}
+
+void wxMenu::ChangeFont(bool keepOriginalSize)
+{
+ // Lesstif 0.87 hangs here, but 0.93 does not
+#if !wxCHECK_LESSTIF() || wxCHECK_LESSTIF_VERSION( 0, 93 )
+ if (!m_font.Ok() || !m_menuWidget)
+ return;
+
+ WXFontType fontType = m_font.GetFontType(XtDisplay((Widget) m_menuWidget));
+
+ XtVaSetValues ((Widget) m_menuWidget,
+ wxFont::GetFontTag(), fontType,
+ NULL);
+ if (m_buttonWidget)