Dialog.menu flags are not working

It seems that you can’t use any flag other than 0 for the entries in a popup menu; otherwise, some of them will disappear. Is that by design?

function OnClick(clickData) {
	DOpus.ClearOutput();
	var dlgMenu = DOpus.Dlg();
	var choices = ['title 1', 'entry 1.1', 'entry 1.2', 'title 2', 'entry 2.1'];
	dlgMenu.choices = choices;
	dlgMenu.menu = [9, 0, 0, 9, 0];
	dlgMenu.Show();
	if (dlgMenu.result) {
		DOpus.Output('You selected ' + choices[dlgMenu.result - 1]);
	}
}

title 2 isn't appearing because you're setting the "default item" flag (1) twice (once for title 1 and again for title 2).

Menus can't have more than one default item so the add fails the second time.

If you change the second 9 to an 8 it works: