[SOLVED] WidgetWindow Z order


Recommended Posts

Hello , 

I have a problem with render order WidgetWindows . Let's have windows win_1 and win_2 , when I set both

win_1->setOrder(1) and win_2->setOrder(2) , on init stage , it's working, win_2 is top. But when I set

win_2->setOrder(2) in update loop , win_2 is still under the win_1.  

It's some way to refresh gui to render WidgetWindows in correct order ? 

Thank you for any help.



Link to post

Hi. Try Widget::raise(...) by next way.

int update() override
		auto gui = Gui::get();

		static int o = 0;
		if (Input::isKeyDown(Input::KEY_C)) o = 1 - o;

		m_window2->setOrder(1- o);

		return 1;


  • Like 1
Link to post

Thank you,  gui->getVBox()->raise , works for me. 

  • Like 1
Link to post
  • silent changed the title to [SOLVED] WidgetWindow Z order