Setting the font/foreground/background of wxMenu items.

wxMenu items.

Shoemaker, Ronnie A. wrote:

Hi, I am a newbie to xwPython. I am using version 2.4 on Red Hat
Linux. I started with a simply.py example and have changed some
colors and fonts, positions, etc. but have been unable to change the
font or color of the text on the menu. I read in the xwMenu
documentation that

Also please note that the methods related to fonts and

bitmaps are currently only implemented for Windows and

Does this mean I can't alter look of the wxMenu text or its items?

Since we are using native menu widgets then you can alter things only if
the platform supports it. The way to customize the attributes of a menu
item is to actually create the menu item first and then add it to the
menu. Like this:

         item = wx.MenuItem(menu, ID ,"Label")
         item.SetBitmap(...)
  item.SetFont(...)
         menu.AppendItem(item)

If the platform doesn't support some attribute (or support hasn't been
added to the wxWidgets layer yet) then it will just be ignored.

ยทยทยท

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Thursday, February 17, 2005 9:01 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Setting the font/foreground/background of

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks, Robin,

I guess my system doesn't support it. It allows me to create the item:
  item = wx.MenuItem(menu, ID ,"Label")
but
  item.SetFont(...)
gives AttributeError: 'MenuItem' object has no attribute 'SetFont'
Also:
  menu.AppendItem(item)
says Append takes at least 3 arguments, two given.

Ron
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org