UI::Various::Window - general top-level window widget of UI::Various
use UI::Various; my $main = UI::Various::main(); my $window = $main->window(); $window->add(UI::Various::Text->new(text => 'Hello World!')); ... $main->mainloop();
This module defines the general (main) window object of an application using UI::Various.
Besides the common attributes inherited from UI::Various::widget and UI::Various::toplevel the Window widget knows the following additional attributes:
UI::Various::widget
UI::Various::toplevel
Window
an optional title string for the window 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 Window class itself:
see UI::Various::core::construct
$window->destroy();
destroy removes the window 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 window was the last one of the application, this also causes the main loop to be finished.
destroy
main loop
Note that a window 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 window again, you have to recreate it.
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.