Grid

class lpyout.Grid(x, y, w, h, row_count, col_count, parent=None, anchor=Anchor.TOP_LEFT, p=None, px=None, py=None, pl=None, pr=None, pt=None, pb=None, m=None, mx=None, my=None, ml=None, mr=None, mt=None, mb=None, value=None, widths=None, heights=None, max_w=inf, max_h=inf, rspan=1, cspan=1, spacing=0, index=(0, 0))

Bases: object

Attributes Summary

cspan

h

p

Padding for the grid.

px

Padding-left-right for grid.

py

Padding-top-bottom for grid.

rpsan

rspan

w

x()

y()

Methods Summary

fill_screen(screen, row_count, col_count[, ...])

Make the grid fill the specified screen.

fill_square(screen, row_count, col_count[, ...])

Similar to fillscreen, but it ensures the resulting grid is square by only filling the largest axis.

grid_with_cell_dim(x, y, cell_w, cell_h, ...)

Given a location and cell size, initialize a grid with the specified number of rows and columns.

grid_with_dim(x, y, w, h, row_count, col_count)

Given location and size, intialize a grid with the specified number of rows and columns

realize([anchor])

For a given grid, return the coordinates of that grid.

Attributes Documentation

cspan
h
p

Padding for the grid.

px

Padding-left-right for grid.

py

Padding-top-bottom for grid.

rpsan
rspan
w
x
y

Methods Documentation

classmethod fill_screen(screen, row_count, col_count, p=None, px=None, py=None, pl=None, pr=None, pt=None, pb=None, m=None, mx=None, my=None, ml=None, mr=None, mt=None, mb=None, widths=None, heights=None, spacing=0)

Make the grid fill the specified screen.

classmethod fill_square(screen, row_count, col_count, p=None, px=None, py=None, pl=None, pr=None, pt=None, pb=None, m=None, mx=None, my=None, ml=None, mr=None, mt=None, mb=None, spacing=0)

Similar to fillscreen, but it ensures the resulting grid is square by only filling the largest axis.

classmethod grid_with_cell_dim(x, y, cell_w, cell_h, row_count, col_count, p=None, px=None, py=None, pl=None, pr=None, pt=None, pb=None, m=None, mx=None, my=None, ml=None, mr=None, mt=None, mb=None, spacing=0, anchor=Anchor.TOP_LEFT)

Given a location and cell size, initialize a grid with the specified number of rows and columns.

classmethod grid_with_dim(x, y, w, h, row_count, col_count, p=None, px=None, py=None, pl=None, pr=None, pt=None, pb=None, m=None, mx=None, my=None, ml=None, mr=None, mt=None, mb=None, spacing=0, widths=None, heights=None, parent=None, anchor=Anchor.TOP_LEFT)

Given location and size, intialize a grid with the specified number of rows and columns

realize(anchor=Anchor.CENTER)

For a given grid, return the coordinates of that grid. Notice that this by default returns the center of the grid, but by specifying the anchor you may change this to any percentage for width and height of the cell.