Lightningbeam/PyGUI-2.5.3/Doc/Grid.html

13 lines
4.0 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>Grid class</title></head>
<body><h1>class <span style="font-family: monospace;">Grid(<a href="Frame.html">Frame</a>)</span></h1>A Grid is a container that lays out a collection of components in a two-dimensional grid.<br><br>The
initial size of the container, and the width of each column and height
of each row, are made just large enough to hold their contents. The
horizontal and vertical alignment of components within their cells can
be specified. One row and/or one column may be specified to expand when the Grid is resized.<br><br>In addition, the width and/or height of all items may optionally be equalized before they are laid out.<br><br><i>Note: Don't confuse this with the <a href="GridView.html">GridView</a> class, which is a view providing a regular grid of user-drawn cells.</i><br><h2>Constructor</h2><dl style="margin-left: 40px;"><dt><span style="font-family: monospace;">Grid(</span><span style="font-style: italic;">items</span>, <span style="font-style: italic;">keyword</span> <span style="font-family: monospace;">=</span> <span style="font-style: italic;">value</span><span style="font-family: monospace;">,</span> ...<span style="font-family: monospace;">)</span></dt><dd>Creates a Grid containing the specified <span style="font-style: italic;">items</span>, which should be a sequence of rows, each of which is a sequence of Components. An item may be <span style="font-family: monospace;">None</span> to leave an empty cell in the grid. The following keyword arguments may be used:</dd></dl><table style="text-align: left; margin-left: 80px;" border="0" cellpadding="4" cellspacing="0"><tbody><tr><td style="font-family: monospace;" align="left" valign="top">row_spacing</td><td style="vertical-align: top; white-space: nowrap; text-align: left;">Vertical space to leave between rows.</td></tr><tr><td style="vertical-align: top; text-align: left; font-family: monospace;">column_spacing</td><td style="vertical-align: top; white-space: nowrap; text-align: left;">Horizontal space to leave between columns.</td></tr><tr><td style="white-space: nowrap;"><span style="font-family: monospace;">padding = (0, 0)</span></td><td>Space to leave horizontally and vertically around all the items.</td></tr><tr><td style="vertical-align: top; text-align: left; font-family: monospace;">align = 'c'</td><td style="vertical-align: top; text-align: left; width: 100%;">Alignment of items within cells. A string made up of the letters <span style="font-family: monospace;">'l'</span>, <span style="font-family: monospace;">'r'</span>, <span style="font-family: monospace;">'t'</span>, <span style="font-family: monospace;">'b'</span> and <span style="font-family: monospace;">'c'</span> for left, right, top, bottom and centre.</td></tr><tr><td style="vertical-align: top; text-align: left; font-family: monospace;">equalize = ''</td><td style="vertical-align: top; text-align: left; width: 100%;">Specifies whether to make the size of all items equal in the horizontal and/or vertical direction. One of <span style="font-family: monospace;">'w'</span>, <span style="font-family: monospace;">'h'</span> or <span style="font-family: monospace;">'wh'</span>.</td></tr><tr><td style="white-space: nowrap; vertical-align: top;"><span style="font-family: monospace;">expand_row = None</span></td><td>Index
of a row whose items should change height when the container is
resized. Items in rows above are anchored to the top of the container,
and those in rows below are anchored to the bottom.</td></tr><tr><td style="white-space: nowrap; vertical-align: top;"><span style="font-family: monospace;">expand_column = None</span></td><td>Index
of a column whose items should change width whent the container is
resized. Items in columns to the left are anchored to the left of the
container, and those in columns to the right are anchored to the right.</td></tr></tbody></table><br>---</body></html>