Changes between Version 36 and Version 37 of Development

Show
Ignore:
Timestamp:
09/24/11 15:12:35 (21 months ago)
Author:
ian
Comment:

update description of pupcoming widget container api

Legend:

Unmodified
Added
Removed
Modified
  • Development

    v36 v37  
    99 * [wiki:Themes] - centrally control how widgets look like - I'm undecided about this 
    1010 * SizeHandling - the way some GUIs handle layout 
    11  
    12  
    13 == Cleanup API == 
    14  * get_focus(), set_focus() 
    15    * .set_focus() does accept either a widget or a number for some classes (!GridFlow, Pile, Columns) 
    16    * There is Column.set_focus_column(), Column.get_focus_column() 
    17    * Frame.set_focus() accepts one of 'header', 'footer', 'body' - keep and implement new properties? 
    18    * .get_focus is not always implemented 
    19    * -> .focus property (GET) that is the widget that has the focus. None for leaves. 
    20    * -> .focus_position property (GET/SET) property that is a position value that this widget understands. Undefined for leaves (need to check .focus is None because position None shouldn't have a special meaning). 
    21    * -> .selectable_iter(reverse=False) iterator over selectable values for tuples (widget, position), starting from the current focus. (a regular list won't work for a ListBox that doesn't have access to all its content) 
    22    * -> .get_focus_path() method list of focus settings down to the leaf widget  
    23  * Pile and Columns should be more similar 
    24    * .focus_item (widget) <-> .focus_col (int) 
    25    * .item_types <-> .column_types 
    26    * .get_item_rows() <-> .column_widths() 
    2711 
    2812 
     
    4327 
    4428 
     29 * get_focus(), set_focus() 
     30   * .set_focus() does accept either a widget or a number for some classes (!GridFlow, Pile, Columns) 
     31   * There is Column.set_focus_column(), Column.get_focus_column() 
     32   * Frame.set_focus() accepts one of 'header', 'footer', 'body' - keep and implement new properties? 
     33   * .get_focus is not always implemented 
     34   * -> .focus property (GET) that is the widget that has the focus. None for leaves. 
     35   * -> .focus_position property (GET/SET) property that is a position value that this widget understands. Undefined for leaves (need to check .focus is None because position None shouldn't have a special meaning). 
     36   * -> .get_focus_path() method list of focus positions down to the leaf widget 
     37 * Pile and Columns should be more similar 
     38   * .focus_item (widget) <-> .focus_col (int) 
     39   * .item_types <-> .column_types 
     40   * .get_item_rows() <-> .column_widths() 
     41   * -> .contents_from_focus(reverse=False) iterator over child (widget, position) tuples 
     42   * -> .contents property (GET/SET) is a mapping or list-like (for simple containers) object whose keys are positions and values are (widget, container_specific_data) tuples 
     43   * -> .__getitem__(x) is equivalent to .contents[x][0].base_widget 
     44 
    4545== Container Interface == 
    4646 
     
    4949 
    5050source:urwid/container.py 
    51  
    52 Widget Containers have a .widget_list get/set property that gives direct access to the list 
    53 of widgets they contain.  They also implement the read-only parts of the python list interface  
    54 themselves with slightly different behaviour than when accessing the .widget_list property. 
    55 Widget Containers work with Widget Decorations to give easier access to the base widgets contained 
    56 in the container. eg: 
    57  
    58 {{{ 
    59 third_widget = widget_container[2] 
    60 }}}  
    61  
    62 is the same as: 
    63  
    64 {{{ 
    65 third_widget = widget_container.widget_list[2] 
    66 if hasattr(third_widget, 'base_widget'): 
    67     third_widget = third_widget.base_widget 
    68 }}} 
    69  
    70  
    7151 
    7252