Mercurial > getan
changeset 256:bcc5951edaad
Fix compatibility with urwid 1.1
focus is a read only Widget property in urwid 1.1. Therefore it can't be used in
Node to store the if the widget has the focus. Renamed focus to has_focus
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Thu, 11 Apr 2013 11:41:01 +0200 |
parents | fcd0a8b09fcf |
children | 2df167b07763 |
files | getan/nodes.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/getan/nodes.py Thu Apr 11 11:37:55 2013 +0200 +++ b/getan/nodes.py Thu Apr 11 11:41:01 2013 +0200 @@ -19,7 +19,7 @@ def __init__(self, item): self.selected = False - self.focus = False + self.has_focus = False self.item = item w = urwid.AttrMap(self.get_widget(), None) self.__super.__init__(w) @@ -31,7 +31,7 @@ return str(self.item) def update_w(self): - if self.focus: + if self.has_focus: if self.selected: self._w.set_focus_map({None: 'selected focus entry'}) self._w.set_attr_map({None: 'selected focus entry'}) @@ -65,7 +65,7 @@ return key def render(self, size, focus=False): - self.focus = focus + self.has_focus = focus self.update_w() return self._w.render(size, focus)