finding a menuitem from a menubar given an item id

Hi!

I'm trying to get a handle to a menuitem given its' id. I tried

       item = menubar.FindItem(id)

but gave me "wxMenuBar instance has no attributef FindItem".

Then I tried looping through the menus by

       for i in range(0, number_of_menus):
               menu = menubar.GetMenu(i)
               item = menu.FindItem(id)

but then I just get wxNOT_FOUND.

Any ideas?

Have you tried item = menubar.FindItemById(id)

?

/Jesper
--
Jesper Eskilson

Jon.

"Jonathan Bills" <Jonathan.Bills@marconi.com> writes:

Have you tried item = menubar.FindItemById(id)

That works, thanks!

FindItemById() is not documented in the version I have (2.3.something).

/Jesper

···

--
Jesper Eskilson
Virtutech