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
Layout::Manager::Grid(3) User Contributed Perl Documentation Layout::Manager::Grid(3)

Layout::Manager::Grid - Simple grid-based layout manager.

Layout::Manager::Grid is a layout manager places components into evenly divided cells.

When you instantiate a Grid manager, you must supply it with a count of how many rows and columns it will have. For example, a Grid with 1 column and 2 rows would look like:

  +--------------------------------+
  |                                |
  |           component 1          |
  |                                |
  +--------------------------------+
  |                                |
  |           component 2          |
  |                                |
  +--------------------------------+

The container is divided into as many <rows> * <columns> cells, with each taking up an equal amount of space. A grid with 3 columns and 2 rows would create 6 cells that consume 33% of the width and 50% of the height.

Components are placed by specifying the cell they reside in via the row and column number.

  $container->add_component($comp, { row => 0, column => 3 });

  $container->add_component($comp, { row => 0, column => 2, height => 2 });

Optionally, you may choose to override the default "width" or "height" of 1. Setting it to a something else will cause the component to consume that many rows or columns worth of space.

Grid is similar to Java's GridLayout <http://java.sun.com/docs/books/tutorial/uiswing/layout/grid.html>.

  $cont->add_component($comp1, { row => 0, column => 1 });
  $cont->add_component($comp2, { row => 0, column => 2 });

  my $lm = Layout::Manager::Grid->new(rows => 1, columns => 2);
  $lm->do_layout($con);

If the container that the Grid is manging does not have one or both of it's dimensions set, Grid will compute the appropriate sizes. The simple way for me to avoid writing a long explanation is to say it works similar to HTML tables. Rows will become as big as their biggest consituent, as will columns. It is common to add a Grid-managed component to a scene with only one of it's dimensions set.

The number of columns in this Grid.

The number of rows in this Grid.

Size and position the components in this layout.

Cory Watson, "<gphat@cpan.org>"

Copyright 2008 - 2010 Cory G Watson

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2014-01-25 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.