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 » Modal vs non-modal window
Re: Modal vs non-modal window [message #12009 is a reply to message #12008] Sun, 07 October 2007 20:32 Go to previous messageGo to previous message
NeonN is currently offline  NeonN
Messages: 8
Registered: September 2007
Location: Czech Republic
Promising Member
For example:
I have one window with button. The button has assigned callback to function that creates another window...

If I just do this:
void ClassName::InitDialog()
{
	WithLayout<TopWindow> laySomething;
	CtrlLayoutOKCancel(laySomething, "Something");
	laySomething.OpenMain();
}

... the window disappear after the function is over. I'd have to Execute() the window or ... (I don't know... I'm new in C++ and Ultimate++. I'm trying to understand how to work with the window - what is the best method...)

But when I do this:
void ClassName::InitDialog()
{
	laySomething = new WithSomethingLayout<TopWindow>;
	CtrlLayoutOKCancel(*laySomething, "Something");
	laySomething->OpenMain();
}

... the window is still opened. I can do anything with the window because the pointer to it is declared in the private part of class but the memmory is allocated only when I need it. And when I close the window, the widgets are automatically cleared (destroyed).
So that's why i don't understand why is using new/delete less alegant or less easier... and why I shouldn't do this...

[Updated on: Sun, 07 October 2007 20:56]

Report message to a moderator

 
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TopWindow Backup/Restore
Next Topic: Minor bug: TopWindow::GetStdSize()
Goto Forum:
  


Current Time: Mon May 06 05:55:35 CEST 2024

Total time taken to generate the page: 0.02644 seconds