GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Tickit::WidgetRole::Alignable(3) User Contributed Perl Documentation Tickit::WidgetRole::Alignable(3)

"Tickit::WidgetRole::Alignable" - implement widgets with adjustable alignment

Mixing this parametric role into a Tickit::Widget subclass adds behaviour to implement alignment of content within a possibly-larger space.

The following methods are provided parametrically on the caller package when the module is imported by

   use Tickit::WidgetRole::Alignable
      name    => NAME,
      style   => STYLE,
      reshape => RESHAPE;

The parameters are

name => STRING
Optional. The name to use for "NAME" in the following generated methods. Defaults to 'align' if not provided.
dir => "h" or "v"
Optional. The direction, horizontal or vertical, that the alignment represents. Used to parse symbolic names into fractions. Defaults to 'h' if not provided.
reshape => BOOL
Optional. If true, the widget will be reshaped after the value has been set by calling the "reshape" method. If false or absent then it will just be redrawn by calling "redraw".

   $align = $widget->NAME

Return the current alignment value

   $widget->set_NAME( $value )

Set the new alignment value

Gives a value in the range from 0.0 to 1.0 to align the content display within the window.

For vertical direction alignments, the symbolic values "top", "middle" and "bottom" can be supplied instead of 0.0, 0.5 and 1.0 respectively.

For horizontal direction alignments, the symbolic values "left", "centre" and "right" can be supplied instead of 0.0, 0.5 and 1.0 respectively.

   ( $before, $alloc, $after ) = $widget->_NAME_allocation( $value, $total )

Returns a list of three integers created by aligning the $value to the given alignment position within the $total. See also "align" in Tickit::Utils.

Paul Evans <leonerd@leonerd.org.uk>
2022-04-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.