NAME

UI::Various::Window - general top-level window widget of UI::Various

SYNOPSIS

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

ABSTRACT

This module defines the general (main) window object of an application using UI::Various.

DESCRIPTION

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

Attributes

title [rw, fixed, optional]

an optional title string for the window 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 Window class itself:

new - constructor

see UI::Various::core::construct

destroy - remove window from application

$window->destroy();

description:

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.

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.

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>