Hi Ian, I've attached a patch for Padding in hg. It seems that .w was renamed to ._original_widget--this patch fixes a few more instances.
If this is nothing you can use, feel free to ignore it... :) In any case, thanks for urwid! Andreas
diff -r e8c070db8be7 urwid/container.py --- a/urwid/container.py Sun Nov 09 20:29:36 2008 -0500 +++ b/urwid/container.py Fri Nov 14 02:43:51 2008 -0500 @@ -143,7 +143,7 @@ """Set the focus to the item in focus in the display widget.""" if isinstance(w, Padding): # unwrap padding - w = w.w + w = w._original_widget w = w.get_focus() if w in self.cells: self.set_focus(w) diff -r e8c070db8be7 urwid/decoration.py --- a/urwid/decoration.py Sun Nov 09 20:29:36 2008 -0500 +++ b/urwid/decoration.py Fri Nov 14 02:43:51 2008 -0500 @@ -412,31 +412,31 @@ return self._original_widget.rows((maxcol-left-right,), focus=focus) def keypress(self, size, key): - """Pass keypress to self.w.""" + """Pass keypress to self._original_widget.""" maxcol = size[0] left, right = self.padding_values(size, True) maxvals = (maxcol-left-right,)+size[1:] - return self.w.keypress(maxvals, key) + return self._original_widget.keypress(maxvals, key) def get_cursor_coords(self,size): - """Return the (x,y) coordinates of cursor within self.w.""" - if not hasattr(self.w,'get_cursor_coords'): + """Return the (x,y) coordinates of cursor within self._original_widget.""" + if not hasattr(self._original_widget,'get_cursor_coords'): return None left, right = self.padding_values(size, True) maxcol = size[0] maxvals = (maxcol-left-right,)+size[1:] - coords = self.w.get_cursor_coords(maxvals) + coords = self._original_widget.get_cursor_coords(maxvals) if coords is None: return None x, y = coords return x+left, y def move_cursor_to_coords(self, size, x, y): - """Set the cursor position with (x,y) coordinates of self.w. + """Set the cursor position with (x,y) coordinates of self._original_widget. Returns True if move succeeded, False otherwise. """ - if not hasattr(self.w,'move_cursor_to_coords'): + if not hasattr(self._original_widget,'move_cursor_to_coords'): return True left, right = self.padding_values(size, True) maxcol = size[0] @@ -447,29 +447,29 @@ elif x >= maxcol-right: x = maxcol-right-1 x -= left - return self.w.move_cursor_to_coords(maxvals, x, y) + return self._original_widget.move_cursor_to_coords(maxvals, x, y) def mouse_event(self, size, event, button, x, y, focus): - """Send mouse event if position is within self.w.""" - if not hasattr(self.w,'mouse_event'): + """Send mouse event if position is within self._original_widget.""" + if not hasattr(self._original_widget,'mouse_event'): return False left, right = self.padding_values(size, focus) maxcol = size[0] if x < left or x >= maxcol-right: return False maxvals = (maxcol-left-right,)+size[1:] - return self.w.mouse_event(maxvals, event, button, x-left, y, + return self._original_widget.mouse_event(maxvals, event, button, x-left, y, focus) def get_pref_col(self, size): - """Return the preferred column from self.w, or None.""" - if not hasattr(self.w,'get_pref_col'): + """Return the preferred column from self._original_widget, or None.""" + if not hasattr(self._original_widget,'get_pref_col'): return None left, right = self.padding_values(size, True) maxcol = size[0] maxvals = (maxcol-left-right,)+size[1:] - x = self.w.get_pref_col(maxvals) + x = self._original_widget.get_pref_col(maxvals) if type(x) == type(0): return x+left return x
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
