Jump to content

Setting the name and icon for group window


photo

Recommended Posts

Hi

With the new window manager, you can stack/group multiple windows together. That is great! But when grouping two windows with the mouse, the newly created group window has the default Unigine icon and the title "UNIGINE Window".

Is there a callback or a setting we can use to set the title and icon of dynamically created group window?

Thanks!

Edited by Amerio.Stephane
  • Like 1
Link to comment

Hello,

You can use CALLBACKS_WINDOWS_STACKED from the window manager. Two grouped windows will be passed to this callback. Here is a small example:

void on_stack(EngineWindowPtr w0, EngineWindowPtr w1)
{
	EngineWindowPtr group = w0->getParentGroup();
	group->setTitle(String::format("Group: %s and %s", w0->getTitle(), w1->getTitle()));
	// and set icon: group->setIcon(new_icon);
}

int AppSystemLogic::init()
{
	EngineWindow::create("Window 0", 512, 256, EngineWindow::FLAGS_SHOWN);
	EngineWindow::create("Window 1", 512, 256, EngineWindow::FLAGS_SHOWN);

	WindowManager::addCallback(WindowManager::CALLBACKS_WINDOWS_STACKED, MakeCallback(on_stack));

	return 1;
}

 

  • Thanks 3
Link to comment
×
×
  • Create New...