Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Multiple main windows, but only one active (Multiple main windows, but only one active)
Multiple main windows, but only one active [message #48578] Tue, 01 August 2017 00:36 Go to previous message
Jose Luis is currently offline  Jose Luis
Messages: 3
Registered: February 2015
Junior Member
Hi,
This is my first message on the forum.
I'm making an application in which I want to be able to open a new main window and close the previous one.
That is, I want to re-run my program from scratch without having to close it or reset all variables manually.
I use next code:

UI_APP_MAIN
{
(new App)->OpenMain();
Ctrl::EventLoop();
}

And I call next function to close the active main windows and open another main window:

void App::CloseAndOpen()
{
delete this;
(new App)->OpenMain();
}

The function CloseAndOpen seems to work correctly if I only use it once or twice, but I have tried it intensively, and after several consecutive calls the program fails and closes (not always at the same number of consecutive calls).
Can be the failure caused by the repetitive and consecutive use of OpenMain()?
Is there any better way to get what I want ?. Is something missing from my code?
Thanks.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Modify richedit component of Uword demo
Next Topic: Cross-compiling for Raspbian
Goto Forum:
  


Current Time: Mon Apr 29 16:43:29 CEST 2024

Total time taken to generate the page: 0.02196 seconds