Change fg/bg Colour for menu items [MSW2.9]

Vadim Zeitlin vadim at wxwidgets.org
Thu Nov 1 13:12:44 PDT 2007


On Thu, 1 Nov 2007 10:42:29 +0100 Andreas Oppermann <Andreas-Oppermann at oss-gmbh.de> wrote:

AO> I also added the font setting to my menuitem changes.
AO> Unfortunately no effect.
AO> When I am looking at the sample the menu item is added to the menu after 
AO> setting the attributs.

 There must be something else because I've just tried this patch

Index: samples/ownerdrw/ownerdrw.cpp
===================================================================
--- samples/ownerdrw/ownerdrw.cpp       (revision 49505)
+++ samples/ownerdrw/ownerdrw.cpp       (working copy)
@@ -161,8 +161,6 @@

     pItem = new wxMenuItem(file_menu, Menu_Bitmap, _T("&Bell"),
                            _T("check/uncheck me!"), wxITEM_CHECK);
-    pItem->SetFont(fontBmp);
-    pItem->SetBitmaps(bmpBell);
     file_menu->Append(pItem);

     pItem = new wxMenuItem(file_menu, Menu_Bitmap2, _T("So&und"),
@@ -202,6 +200,10 @@

     menu_bar->Append(file_menu, _T("&File"));
     SetMenuBar(menu_bar);
+
+    pItem = menu_bar->FindItem(Menu_Bitmap);
+    pItem->SetFont(fontBmp);
+    pItem->SetBitmaps(bmpBell);
 }

 // main frame constructor

and it still works for me.

 Please try to reproduce the problem in the sample (with minimal changes).

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list