Jump to content

WidgetWindow not showing in UnigineScript


photo

Recommended Posts

Hi,

In a very simple UnigineScript file, I added the following code :

WidgetWindow window;
int init()
{
	Gui gui = engine.getGui();

	window = new WidgetWindow(gui, "Hello from C++", 4, 4);
	window.setWidth(320);
	window.setSizeable(1);

	WidgetEditLine editline = new WidgetEditLine(gui, "Edit me");
	window.addChild(editline, GUI_ALIGN_EXPAND);
	editline.setFontSize(16);

	WidgetButton button = new WidgetButton(gui, "Press me");
	window.addChild(button, GUI_ALIGN_EXPAND);
	button.setFontSize(18);

	window.arrange();
	gui.addChild(window, GUI_ALIGN_OVERLAP | GUI_ALIGN_CENTER);
  	
  	return 1;
}

The code seems to be executed without any errors or warnings, but I can't see any window upon initialization.

Am I missing something?

Thanks

Link to comment
×
×
  • Create New...