Knowledgebase: Technical
Dynamic Menus
Posted by Gian Luca De Bonis, Last modified by Gian Luca De Bonis on 27 September 2010 01:32 PM
I get an error while I’m translating a dynamic menu, in of_getcontext() or of_getchildren(). Are dynamic menus supported?

Dynamic menus are not directly supported by PB, but you can manipulate the items array in the code. A dynamic menu can have empty (NULL) menu items, and this provokes the Engine to fail.

Before translating a dynamic menu, make sure that no empty items are present, assign empty items a dummy item and make it invisible. Sample code:

for li = 1 to m_main.m_options.item[]
if not isvalid(m_main.m_options.item[li]) then
m_main.m_options.item[li]=m_main.m_help.item[1] // any valid menu item can be used
m_main.m_options.item[li].visible = false
(31 vote(s))
Not helpful

Comments (0)