Home » U++ Library support » TopWindow&PopUp, TrayIcon » Modal vs non-modal window
Re: Modal vs non-modal window [message #12016 is a reply to message #12015] |
Mon, 08 October 2007 10:52   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
NeonN wrote on Mon, 08 October 2007 03:14 | Thx, i get it now... i wasn't thinking about that (making the dialow window class member). But I'm not very exited opening the window this way because it's IMHO wasting free memmory... the dialog window is allocated all the time when main window is running...
Maybe it's not so important for me because the app i am porting will be using at most 5-10 small dialogs... but anyway, i don't like it at all ....
|
Yep, that is, in theory, a valid concern.
Anyway, how big is subdialog? Single widget occupies 100-200 bytes, so it is usually less than 5KB. People tend to waste much more in other parts of code without even knowing 
Another important issue is that you will get access to the dialog, all its settings and values, for free. With new, you would in most cases needed to store a pointer to subdialog anyway.
OTOH, if the memory really is concern, you can use something like
class ClassName {
...
One< WithLayout<TopWindow> > laySomething;
...
};
void ClassName::InitDlg()
{
...
laySomething.Create();
...
}
In this case, data will be allocated on demand, while still keeping the advantage of deterministic cleanup.
|
|
|
 |
 |
Modal vs non-modal window
By: NeonN on Wed, 03 October 2007 20:13
|
 |
|
Re: Modal vs non-modal window
By: mrjt on Thu, 04 October 2007 13:08
|
 |
|
Re: Modal vs non-modal window
By: NeonN on Thu, 04 October 2007 18:59
|
 |
|
Re: Modal vs non-modal window
By: NeonN on Thu, 04 October 2007 20:08
|
 |
|
Re: Modal vs non-modal window
By: mrjt on Fri, 05 October 2007 12:09
|
 |
|
Re: Modal vs non-modal window
By: NeonN on Fri, 05 October 2007 13:47
|
 |
|
Re: Modal vs non-modal window
By: mrjt on Fri, 05 October 2007 14:47
|
 |
|
Re: Modal vs non-modal window
By: mirek on Sat, 06 October 2007 18:07
|
 |
|
Re: Modal vs non-modal window
By: NeonN on Sun, 07 October 2007 18:33
|
 |
|
Re: Modal vs non-modal window
By: mirek on Sun, 07 October 2007 19:37
|
 |
|
Re: Modal vs non-modal window
By: NeonN on Sun, 07 October 2007 20:32
|
 |
|
Re: Modal vs non-modal window
By: mirek on Sun, 07 October 2007 23:46
|
 |
|
Re: Modal vs non-modal window
By: NeonN on Mon, 08 October 2007 09:14
|
 |
|
Re: Modal vs non-modal window
By: mirek on Mon, 08 October 2007 10:52
|
 |
|
Re: Modal vs non-modal window
By: NeonN on Mon, 08 October 2007 14:58
|
 |
|
Re: Modal vs non-modal window
By: mirek on Sat, 06 October 2007 17:59
|
 |
|
Re: Modal vs non-modal window
By: exolon on Fri, 05 October 2007 11:55
|
Goto Forum:
Current Time: Mon Apr 28 18:16:40 CEST 2025
Total time taken to generate the page: 0.01053 seconds
|