[SOLVED] Tree Menu

I am trying to build a tree menu. I am starting small to see what works, then build on it. I want it to be dynamic so I am building it OnLoad

I create a new application, select TreeMenu.

Then I enter this in the OnLoad section

sc_appmenu_reset(‘menu’);
sc_appmenu_create(‘menu’);

sc_appmenu_add_item(
‘menu’,
‘0’,
‘0’,
1,
1,
1, 1, 1,
);

sc_appmenu_add_item(
‘menu’,
‘menu1’,
‘sample3’,
,
,
, , ,
);
sc_appmenu_add_item(
‘menu’,
‘menu2’,
‘sample5’,
,
,
, , ,
);

Nothing comes up. WHY?

Re: Tree Menu

try this :

[b]$menu = “testtree”;
//-------------------------------------------------------------------------
sc_appmenu_reset($menu);
sc_appmenu_create($menu);
//-------------------------------------------------------------------------
//sc_appmenu_add_item(“String Menu_Name”, “Id_Item”, “Id_Parent”, “Label”, “Aplication”, “Parameters”, “Icon”, “Hint”, “Target”)

sc_appmenu_add_item($menu,‘itm_0’,‘Root_Label_1’,);

sc_appmenu_add_item($menu,‘itm_1’,‘itm_0’,‘Child_Label_1_1’,);

sc_appmenu_add_item($menu,‘itm_2’,‘itm_0’,‘Child_Label_1_2’,);

sc_appmenu_add_item($menu,‘itm_3’,‘Root_Label_2’,);

sc_appmenu_add_item($menu,‘itm_4’,‘itm_3’,‘Child_Label_2_1’,);
[/b]

Re: Tree Menu

sc_appmenu_reset($menu);
sc_appmenu_create($menu);

$menu needs to be the name of the application … that was my problem.

Aaargh! This is still a problem 9 years later and STILL not documented anywhere useful. I’ve wasted 2 hours before finding this…!