summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorIan Ward <ian@excess.org>2012-10-12 10:18:55 -0400
committerIan Ward <ian@excess.org>2012-10-12 10:18:55 -0400
commitef84ceb36208ce93db34367ff8e561c7b99a2cd2 (patch)
tree4bd9633650264a9d6075a99c825adbcaf8d5cde6 /docs
parent2c6eea6ff7ffd9d6869b2b13bab74ebfa57a817f (diff)
downloadurwid-ef84ceb36208ce93db34367ff8e561c7b99a2cd2.tar.gz
manual: widget sizing table
Diffstat (limited to 'docs')
-rw-r--r--docs/manual/widgets.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/manual/widgets.rst b/docs/manual/widgets.rst
index 1ed7140..3e8df15 100644
--- a/docs/manual/widgets.rst
+++ b/docs/manual/widgets.rst
@@ -66,6 +66,23 @@ Occasionally it is also useful to have a widget that knows how many screen
columns and rows it requires, regardless of the space available. This is
called a fixed widget.
+.. list-table:: How a Widget's Size is Determined
+ :widths: 20 40 40
+ :header-rows: 1
+
+ * - sizing mode
+ - width
+ - height
+ * - ``'box'``
+ - container decides
+ - container decides
+ * - ``'flow'``
+ - container decides
+ - widget's :meth:`rows() <Widget.rows>` method
+ * - ``'fixed'``
+ - widget's :meth:`pack() <Widget.pack>` method
+ - widget's :meth:`pack() <Widget.pack>` method
+
It is an Urwid convention to use the variables :attr:`maxcol` and
:attr:`maxrow` to store a widget's size. Box widgets require both of ``(maxcol,
maxrow)`` to be specified.
@@ -75,6 +92,7 @@ calculate their :attr:`maxrow` based on the :attr:`maxcol` value.
Fixed widgets expect the value ``()`` to be passed in to functions that take
a size because they know their :attr:`maxcol` and :attr:`maxrow` values.
+
.. _basic-grafic-widgets:
Included Widgets