Hello together I’m back with some new problems ^^’
As part of the use I’ll be able to show context menus. I’ve see that tonegod has an nice class Menu which supports sub menu’s. But after a few tests it just looks bugged.
When I initialize a Menu on the following way:
Vector2f cursorPosition2D = app.getInputManager().getCursorPosition();
Menu menu = new Menu(screen, UIDUtil.getUID(), Vector2f.ZERO, screen.getStyle("Menu").getVector2f("defaultSize"), screen.getStyle("Menu").getVector4f("resizeBorders"), "Interface/defaultImg/panelDefaultImageDark.png", false) {
@Override
public void onMenuItemClicked(int index, Object value, boolean isToggled) { }
};
menu.addMenuItem("Test", 0, null);
screen.addElement(menu);
menu.showMenu(menu, cursorPosition2D.x, cursorPosition2D.y);
The Menu shows up fine with one content which has the caption “Test”. But when I click on it, an stack overflow error occur. I’ve evaluated that the error comes from that the Menu after the click want to close sub menu’s (hasSubMenu is set to true) even if there isn’t any sub menu set (look upside the code). In cause of that the method calls itself as long as the stack overflows.
If I made any mistake tell me I just want to have to ask for any known buggs before programming it by myself again
Thanks
Nexor