UI::Various::Dialog - general top-level dialogue widget of UI::Various
use UI::Various; my $main = UI::Various::main(); my $dialog = $main->dialog(); $dialog->add(UI::Various::Text->new(text => 'Hello World!')); ... $main->mainloop();
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.
Window|UI::Various::Window
Besides the common attributes inherited from UI::Various::widget and UI::Various::toplevel the Dialog widget knows the following additional attributes:
UI::Various::widget
UI::Various::toplevel
Dialog
an optional title string for the dialogue as string or variable reference
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:
see UI::Various::core::construct
$dialog->destroy();
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.
destroy
main loop
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.
$dialog->draw();
draw draws / shows and process the dialogue, if the UI is already active. It is only used by some UIs, notably Tk.
draw
Tk
Note that it is called draw and not show as an internal method _show already exists for some other UI/widget combinations.
show
_show
UI::Various
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.
Thomas Dorner <dorner (at) cpan (dot) org>
To install UI::Various, copy and paste the appropriate command in to your terminal.
cpanm
cpanm UI::Various
CPAN shell
perl -MCPAN -e shell install UI::Various
For more information on module installation, please visit the detailed CPAN module installation guide.