567 views
in GUI Development by
If a Dialog 'A' presents a Dialog 'B', but the parent of 'A' dismisses it with DismissDialog() what happens to the child 'B'? Does it continue to exist as a Dialog until the GC runs, or does it exist beyond that?

1 Answer

0 votes
by
 
Best answer
Hello Robert,

if dialog B is presented in context of dialog A and dialog A is dismissed, also the dialog B will disappear from screen. Furthermore, if there is no other reference to A or B retaining the objects alive, the objects are also discarded by GC. If you want dialog B to remain on screen after dialog A is dismissed, don't present B in context of A. Instead present it in context of e.g. the owner of A.

Does it help you further?

Best regards

Paul Banach
by
Thanks, that's helpful. I'm not wanting for dialog B to remain on the screen; the question was really whether child dialogs should be dismissed before the parent is. In my situation it seems that for the child dialog IsDialog(false) == true for some time (i.e. at least several seconds) after the parent is dismissed. Presumably this is because it remains a dialog until it is discarded by the GC? Would IsDialog(true) the better choice here, or perhaps IsActiveDialog()? The dialog is a warning screen which has a timer that triggers a beep every few seconds - as per my previous question I have the timer slot check IsDialog(false) which works if the warning screen is dismissed.
by

Hello Robert,

Presumably this is because it remains a dialog until it is discarded by the GC? 

yes, B dialog acts still as dialog in context of A. The operation B.IsDialog(false) returns thus true. As you yourself have recognized, IsDialog(true) or IsActiveDialog() can be used instead. These methods return true only, when the affected component and all superior components till the root object act as dialogs.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...