Home » U++ Library support » TopWindow&PopUp, TrayIcon » One Main TopWindow and several others TopWindows, how? [SOLVED...]
|
|
|
Re: One Main TopWindow and several others TopWindows, how? [message #1794 is a reply to message #1789] |
Sun, 19 March 2006 08:37   |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
ok, I need something like this:
#include <CtrlLib/CtrlLib.h>
GUI_APP_MAIN
{
TopWindow w1main;
TopWindow w2;
TopWindow w3;
w1main.SetRect(0,0,100,100);
w1main.OpenMain();
w1main.Title("w1main").Run();
w2.SetRect(200,200,200,200);
w2.Open(&w1main);
w2.Title("w2").Run();
w3.SetRect(400,400,300,300);
w3.Open(&w1main);
w3.Title("w3").Run();
}
How to make it work?
|
|
|
|
|
Re: One Main TopWindow and several others TopWindows, how? [message #1799 is a reply to message #1796] |
Sun, 19 March 2006 10:38   |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
luzr wrote on Sun, 19 March 2006 09:13 | Use OpenMain for all windows, but issue Run for the "main" window instead of Ctrl::EventLoop. That way, loop will be ended by closing the "main" window (and rest will get closed by destructors).
Mirek
|
Thanks! This works now:
#include <CtrlLib/CtrlLib.h>
GUI_APP_MAIN
{
TopWindow w1;
TopWindow w2;
TopWindow w3main;
w1.SetRect(650,500,100,100);
w1.OpenMain();
w1.Title("w1");
w2.SetRect(400,300,200,200);
w2.OpenMain();
w2.Title("w2");
w3main.SetRect(50,50,300,300);
w3main.OpenMain();
w3main.Title("w3main").Run(); //you must Run() the last one!
}
|
|
|
|
Goto Forum:
Current Time: Wed Apr 30 06:27:50 CEST 2025
Total time taken to generate the page: 0.04089 seconds
|