+ if (id == m_menuId)
+ {
+ if (it)
+ *it = (wxMenuItem*) NULL;
+ return m_buttonWidget;
+ }
+
+ for ( wxMenuItemList::Node *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::Node *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::Node *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 when setting XmNfontList
+#ifndef LESSTIF_VERSION
+ if (!m_font.Ok() || !m_menuWidget)
+ return;
+
+ XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay((Widget) m_menuWidget));
+
+ XtVaSetValues ((Widget) m_menuWidget,
+ XmNfontList, fontList,
+ NULL);
+ if (m_buttonWidget)