Deprecated Classes

class urwid.FlowWidget

Deprecated. Inherit from Widget and add:

_sizing = frozenset([‘flow’])

at the top of your class definition instead.

Base class of widgets that determine their rows from the number of columns available.

render(size, focus=False)

All widgets must implement this function.

rows(size, focus=False)

All flow widgets must implement this function.

class urwid.BoxWidget

Deprecated. Inherit from Widget and add:

_sizing = frozenset([‘box’]) _selectable = True

at the top of your class definition instead.

Base class of width and height constrained widgets such as the top level widget attached to the display object

render(size, focus=False)

All widgets must implement this function.

class urwid.FixedWidget

Deprecated. Inherit from Widget and add:

_sizing = frozenset([‘fixed’])

at the top of your class definition instead.

Base class of widgets that know their width and height and cannot be resized

pack(size=None, focus=False)

All fixed widgets must implement this function.

render(size, focus=False)

All widgets must implement this function.

class urwid.AttrWrap(w, attr, focus_attr=None)

w – widget to wrap (stored as self.original_widget) attr – attribute to apply to w focus_attr – attribute to apply when in focus, if None use attr

This widget is a special case of the new AttrMap widget, and it will pass all function calls and variable references to the wrapped widget. This class is maintained for backwards compatibility only, new code should use AttrMap instead.

>>> AttrWrap(Divider(u"!"), 'bright')
<AttrWrap flow widget <Divider flow widget '!'> attr='bright'>
>>> AttrWrap(Edit(), 'notfocus', 'focus')
<AttrWrap selectable flow widget <Edit selectable flow widget '' edit_pos=0> attr='notfocus' focus_attr='focus'>
>>> size = (5,)
>>> aw = AttrWrap(Text(u"hi"), 'greeting', 'fgreet')
>>> aw.render(size, focus=False).content().next()
[('greeting', None, ...'hi   ')]
>>> aw.render(size, focus=True).content().next()
[('fgreet', None, ...'hi   ')]
set_attr(attr)

Set the attribute to apply to the wrapped widget

>> w = AttrWrap(Divider(“-”), None) >> w.set_attr(‘new_attr’) >> w <AttrWrap flow widget <Divider flow widget ‘-‘> attr=’new_attr’>

set_focus_attr(focus_attr)

Set the attribute to apply to the wapped widget when it is in focus

If None this widget will use the attr instead (no change when in focus).

>> w = AttrWrap(Divider(“-”), ‘old’) >> w.set_focus_attr(‘new_attr’) >> w <AttrWrap flow widget <Divider flow widget ‘-‘> attr=’old’ focus_attr=’new_attr’> >> w.set_focus_attr(None) >> w <AttrWrap flow widget <Divider flow widget ‘-‘> attr=’old’>

class urwid.PollingListWalker(contents)

contents – list to poll for changes

This class is deprecated. Use SimpleFocusListWalker instead.

get_focus()

Return (focus widget, focus position).

get_next(start_from)

Return (widget after start_from, position after start_from).

get_prev(start_from)

Return (widget before start_from, position before start_from).

set_focus(position)

Set focus position.

Table of contents

Previous topic

Metaclasses

Next topic

Changelog

This Page