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


Manual Reference Pages  -  LAYOUT::MANAGER::GRID (3)

.ds Aq ’

NAME

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

CONTENTS

DESCRIPTION

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>.

SYNOPSIS



  $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);



    DYNAMIC SIZING

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.

ATTRIBUTES

    columns

The number of columns in this Grid.

    rows

The number of rows in this Grid.

METHODS

    do_layout

Size and position the components in this layout.

AUTHOR

Cory Watson, <gphat@cpan.org>

COPYRIGHT & LICENSE

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.

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


perl v5.20.3 LAYOUT::MANAGER::GRID (3) 2014-01-25

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