API

class lpyout.Anchor(*values)

Some common anchor points to operator from.

class lpyout.Cell(x, y, w, h, 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, rspan=1, cspan=1, value=None, parent=None, index=(0, 0))

A 1x1 grid

class lpyout.HBox(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, s=0, index=(0, 0))

A nx1 grid

classmethod divide_screen(screen, n, widths=None)

Divide the screen into n equidistant cells column-wise.

class lpyout.Screen(x=0, y=0, w=0, h=0, update_method=<function Screen.<lambda>>)

Mostly for keeping track of the size of the screen and making media queries

property query: ScreenSize

Based on https://tailwindcss.com/docs/responsive-design

class lpyout.ScreenSize(*values)

Based on TailwindCSS. See: https://tailwindcss.com/docs/responsive-design

class lpyout.VBox(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, s=0, index=(0, 0))

A 1xn grid

classmethod divide_screen(screen, n, heights=None)

Divide the screen into n equidistant cells row-wise.

lpyout.frac_coords(v1: Screen | Grid, v2: Screen | Grid)

Compute the fractional (percentage) coords of one viewport in the other.

lpyout.raw_coords(v1: Screen | Grid, v2: Screen | Grid)

Compute the relative coords of one viewport in the other. Raw refers to being raw pixels.