MerzCollectionView

class merz.collectionView.MerzCollectionView(posSize, **kwargs)
MerzCollectionView.get()

Get the items displayed in the collection.

MerzCollectionView.set(items)

Set the items displayed in the collection.

The items must have been created with the :py:method:`MerzCollectionView.makeItem` method. Items can be recycled.

MerzCollectionView.makeItem(*args, **kwargs)

Make an item that will be displayed in the collection. The returned item will be a MerzCollectionViewItem

MerzCollectionView.setLayoutProperties(**kwargs)

Set multiple properties at once. This is faster than settings them individually. The keyword arguments are:

  • inset

  • lineHeight

  • spacing

  • scale

  • alignment

MerzCollectionView.getScale()

Get the scale applied to each item.

MerzCollectionView.setScale(value)

Set the scale applied to each item.

MerzCollectionView.getLineHeight()

Get the line height.

MerzCollectionView.setLineHeight(value)

Set the line height.

The value should be a number in display units.

MerzCollectionView.getSpacing()

Get the spacing between items.

MerzCollectionView.setSpacing(value)

Set the spacing between items.

The value should be a number in display units.

MerzCollectionView.getAlignment()

Get the alignment.

MerzCollectionView.setAlignment(value)

Set the alignment. Options:

  • "left"

  • "center"

  • "right"

  • "justified"

MerzCollectionView.getInset()

Get the (x, y) inset.

MerzCollectionView.setInset(value)

Set the (x, y) inset.

MerzCollectionViewItem

class merz.collectionView.MerzCollectionViewItem(*args, **kwargs)
MerzCollectionViewItem.getName(makeIfNeeded=False)

Get the name assigned to this layer during __init__. If a name was not assigned, and makeIfNeeded is True a random name will be assigned and returned.

MerzCollectionViewItem.setName(value)
MerzCollectionViewItem.getWidth()
MerzCollectionViewItem.setWidth(value)

Set the item width.

MerzCollectionViewItem.getHeight()
MerzCollectionViewItem.setHeight(value)

Set the item height.

MerzCollectionViewItem.getXAdvance()
MerzCollectionViewItem.setXAdvance(value)
MerzCollectionViewItem.getYAdvance()
MerzCollectionViewItem.setYAdvance(value)
MerzCollectionViewItem.getXPlacement()
MerzCollectionViewItem.setXPlacement(value)
MerzCollectionViewItem.getYPlacement()
MerzCollectionViewItem.setYPlacement(value)
MerzCollectionViewItem.getAllowBreakBefore()
MerzCollectionViewItem.setAllowBreakBefore(value)
MerzCollectionViewItem.getForceBreakAfter()
MerzCollectionViewItem.setForceBreakAfter(value)
MerzCollectionViewItem.appendLayer(name, layer, conditions=None)

Append a layer to the item.

MerzCollectionViewItem.getLayer(name)

Get a layer from the item.