NAME

UI::Various::Dialog - general top-level dialogue widget of UI::Various

SYNOPSIS

use UI::Various;
my $main = UI::Various::main();
my $dialog = $main->dialog();
$dialog->add(UI::Various::Text->new(text => 'Hello World!'));
...
$main->mainloop();

ABSTRACT

This module defines the general (main) dialogue object of an application using UI::Various. Apart from being modal a dialogue is very similar to a Window|UI::Various::Window.

DESCRIPTION

Besides the common attributes inherited from UI::Various::widget and UI::Various::toplevel the Dialog widget knows the following additional attributes:

Attributes

title [rw, optional]

an optional title string for the dialogue as string or variable reference

METHODS

Besides the accessors (attributes) described above and the attributes and methods of UI::Various::widget, UI::Various::container and UI::Various::toplevel, the following additional methods are provided by the Dialog class itself:

new - constructor

see UI::Various::core::construct

destroy - remove dialogue from application

$dialog->destroy();

description:

destroy removes the dialogue and all its UI elements from the application (and its main "Window Manager" singleton), hopefully freeing all memory used by the UI. (This may vary depending on the underlying UI package used.) If the dialogue was a stand-alone one, this also causes the main loop to be finished.

Note that a dialogue can not be reused again after destruction as it's broken down into its components to get rid of circular dependencies that may block clean-up of memory. If you want to open the same dialogue again, you have to recreate it.

SEE ALSO

UI::Various

LICENSE

Copyright (C) Thomas Dorner.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See LICENSE file for more details.

AUTHOR

Thomas Dorner <dorner (at) cpan (dot) org>