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 » U++ Library support » TopWindow&PopUp, TrayIcon » windows dont close except by to calls
windows dont close except by to calls [message #17852] Sun, 31 August 2008 13:11 Go to next message
TeCNoYoTTa is currently offline  TeCNoYoTTa
Messages: 138
Registered: July 2008
Location: Egypt
Experienced Member

hello some times some windows dont close except by clicking the X button Twice or calling Close() Twice
Re: windows dont close except by to calls [message #17854 is a reply to message #17852] Sun, 31 August 2008 13:43 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
You probably have a double CtrlLoop or similar construct somewhere. Are you using multiple windows?
Re: windows dont close except by to calls [message #17855 is a reply to message #17854] Sun, 31 August 2008 14:40 Go to previous messageGo to next message
TeCNoYoTTa is currently offline  TeCNoYoTTa
Messages: 138
Registered: July 2008
Location: Egypt
Experienced Member

yes i have multiply windows .... every window is an object

and this window that need twice close() is an object but other windows dont need twice close
Re: windows dont close except by to calls [message #17856 is a reply to message #17855] Sun, 31 August 2008 14:43 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
How do you show it? What methods?
Re: windows dont close except by to calls [message #17857 is a reply to message #17856] Sun, 31 August 2008 14:45 Go to previous messageGo to next message
TeCNoYoTTa is currently offline  TeCNoYoTTa
Messages: 138
Registered: July 2008
Location: Egypt
Experienced Member

i show it by
Settings_Window.Run();

but i have a Question .....how can i call the constructor of the window every time it shows ??
Re: windows dont close except by to calls [message #17858 is a reply to message #17857] Sun, 31 August 2008 15:08 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
TeCNoYoTTa wrote on Sun, 31 August 2008 15:45

i show it by
Settings_Window.Run();


Here's you problem. Run calls Ctrl::EventLoop(), which must be called exactly once. Only use Run for your main window. Use an Open/OpenMain or Execute method to show additional windows.

Or you could not use Run at all:
GUI_APP_MAIN
{
   ...
   MyWindow1 win1;
   win1.OpenMain();
   Ctrl::EventLoop();
}

Additional windows can be opened without Run, with Open, and Ctrl::EventLoop is not necessary outside of the main function.

Quote:


but i have a Question .....how can i call the constructor of the window every time it shows ??

You can't. but you can add a new method to your window class which does all the initialization than is needed when a window is shows and on the last line of that function open the window.
Previous Topic: Maximize Promblem with Ubuntu6.10 on amd64
Next Topic: Is it possible to show a console window in GUI_APP_MAIN?
Goto Forum:
  


Current Time: Thu Mar 28 22:50:32 CET 2024

Total time taken to generate the page: 0.01300 seconds