getting the number of menu items

if I have declared an instance of wx.Menu():

MySubMenu=wx.Menu()

and subsequently Append menu items, how can I tell if that menu has been populated?

At the moment, I increment an integer every time I append a Menu item, then, if the integer is >0, I know that MySubMenu is not empty, but this seems a bit of a kludge.

Is there a more elegant solution?

Many Thanks

Dave Coventry

Dave Coventry wrote:

if I have declared an instance of wx.Menu():

MySubMenu=wx.Menu()

and subsequently Append menu items, how can I tell if that menu has been populated?

At the moment, I increment an integer every time I append a Menu item, then, if the integer is >0, I know that MySubMenu is not empty, but this seems a bit of a kludge.

Is there a more elegant solution?

menu.GetMenuItemCount()

ยทยทยท

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