class documentation

class _ColumnGaps:

View In Hierarchy

Serve _Gap's for complete columns

  • Composed to Grid.colgaps property.
  • The column gaps are represented as a list of 2-tuples of the form: (column_index, width)
Method __init__ Example
Instance Variable grid Grid object
Method has_column Does column gap exist at index n ?
Method set Set a list of column_gaps to private property _list_orig
Method get Get accessor for _list
Method measure Create property _list.
Method count Return the number of column gaps
Method add_to_cells Add _Cell objects with _Gap objects with corresponding coordinates to Grid.cells
Instance Variable _list_orig Original list of tuples defining the column gaps, as set with set method
Instance Variable _list Copy of the _list_orig variable with altered indices depending on Grid.expand_left
def __init__(self, grid=None):

Example

grid.colgaps = _ColumnGaps( grid )
Parametersgridrequired Grid object
grid =
Grid object
_list_orig =
Original list of tuples defining the column gaps, as set with set method
_list =

Copy of the _list_orig variable with altered indices depending on Grid.expand_left

Its indices are altered depending on the expanding far left column. The values are calculated in measure.

(type: list)
def has_column(self, n=-1):

Does column gap exist at index n ?

if grid.colgaps.has_column( 2 ) : pass
Parametersnint, default -1
Returnsbool (type: bool)
def set(self, column_gaps=[]):

Set a list of column_gaps to private property _list_orig

grid.colgaps.set([
    (0, None),    # 1. column gap
    (1, 0),       # 2.    "
    (2, 20),      # 3.    "
    (3, "expand") # 4.    "
])
grid.colgaps.set()
Can only be used before any adds.
Based on _list_orig the _list property is created in method measure.
If called without arguments, properties _list_orig and _list are reset.
The 2-tuples in list column_gaps have the form: (column_index, width)
Parameterscolumn_gapslist of tuples, default [ ]
def get(self):

Get accessor for _list

The _list is created in method measure.

Returnslist of tuples (type: list)
def measure(self):

Create property _list.

If Grid.expand_left is true, the _list_orig is copied to _list, but with incremented x-indices.
If Grid.expand_left is false, the _list_orig is simply copied to _list.
def count(self):
Return the number of column gaps
Returnsint length of property _list (type: int)
def add_to_cells(self):

Add _Cell objects with _Gap objects with corresponding coordinates to Grid.cells

Walk through each tuple in _list property, create a _Gap object with its coordinates,
and put it into a _Cell object and aggregate it to Grid.cells.
API Documentation for gtgrid, generated by pydoctor 21.2.2 at 2021-06-12 11:12:41.