UI::Various::widget - abstract base class for UI elements
# This module should never be used directly! # It is used indirectly via the following: use UI::Various;
This module is the common abstract base class for all kinds of objects in the UI::Various package aka UI elements or widgets.
All UI::Various::[A-Z]* modules are classes with the following common attributes (inherited from UI::Various::widget):
UI::Various::[A-Z]*
UI::Various::widget
(sorted alphabetically)
rw attributes can be read and modified. The later may have some restrictions. (See documentation of specific attribute).
ro attributes can only be read and not modified.
optional attributes may be empty or undef.
undef
recommended attributes may be empty or undef, but it is advisable to give them a proper value.
inherited attributes may be undefined, but if they are read, a possible value will be searched for all the hierarchy up to either the main "Window Manager" object or the top-level Window or Dialogue objects. They may still be undefined everywhere, though.
preferred (maximum) height of a UI element in (approximately) characters, should not exceed max_height of main "Window Manager"
Be careful with small height values as this could lead to undisplayed or even discarded UI elements in some of the possible UIs. If this is the main window, the application could be immediately exited!
a reference to the parent of the current UI element, usually undef for the UI::Various::Main object and defined for everything else
UI::Various::Main
Note that usually this should only be manipulated by methods of UI::Various::container.
UI::Various::container
preferred (maximum) width of a UI element in (approximately) characters, should not exceed max_width of main "Window Manager"
Besides the accessors described above the following methods are available in all UI::Various::[A-Z]* classes:
see UI::Various::core::construct
$top = $ui_element->top;
$top = $ui_element->top; if ($top) { ... }
This method follows the parent relationship until it reaches the top UI element of the hierarchy and returns it. If the parent relationship has a cycle, an error is created and the method returns undef.
parent
error
top UI element
If a read access can't find a value for the object, it tries getting a value from all ancestors up to the main "Window Manager" object. Otherwise see UI::Various::core::access
$ui_element->_toplevel;
Return the toplevel parent UI element of any UI container. While above top usually returns the UI::Various::Main element this call usually returns a UI::Various::Window or UI::Various::Dialog. In addition it does not have sanity checks.
top
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.