Changes between Version 2 and Version 3 of Manual/WidgetLayout

Show
Ignore:
Timestamp:
12/23/06 13:33:05 (6 years ago)
Author:
ian
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Manual/WidgetLayout

    v2 v3  
    88 
    99[[Image(widget_layout.png)]] 
     10 
     11The topmost widget ''(a)'' is rendered the full size of the 
     12screen. ''(a)'' then renders ''(b)'', ''(b)'' renders ''(c)'' 
     13and so on.   
     14 
     15When a widget renders its contained widgets it chooses the size 
     16and position of each contained widget.  For example, widget 
     17''(b)'' is responsible for the layout of ''(c)'', ''(d)'' and 
     18''(e)''. 
     19 
     20== Box, Flow and Fixed Widgets == 
     21 
     22The size of a widget is measured in screen columns and rows. 
     23Widgets that are given an exact number of screen columns and  
     24rows are called box widgets. The topmost widget is always 
     25a box widget. 
     26 
     27Much of the information displayed in a console user interface 
     28is text and the best way to display text is to have it flow 
     29from one screen row to the next. Widgets like this that 
     30require a variable number of screen rows are called flow widgets. 
     31Flow widgets are given a number of screen columns and can 
     32calculate how many screen rows they need. 
     33 
     34Occasionally it is also useful to have a widget that knows 
     35how many screen columns and rows it requires, regardless of 
     36the space available.  This is called a fixed widget. 
     37 
     38It is an Urwid convention to 
     39use the variables `maxcol` and `maxrow` to store a widget's  
     40size.  Box widgets use the tuple `(maxcol, maxrow)` in 
     41the signature of functions that are passed a size.   
     42Flow widgets use the single-element tuple `(maxcol,)` instead 
     43because they calculate their `maxrow` based on the `maxcol` 
     44value.  Fixed widgets expect the value `None` to be passed in 
     45to functions that take a size because they know their `maxcol` 
     46and `maxrow` values. 
     47 
     48