Mercurial > urwid-satext
diff urwid_satext/sat_widgets.py @ 53:d34f2b0f68d3
urwid 1.0.0 update: fixed missing is_mouse_press
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 08 Oct 2011 21:14:41 +0200 |
parents | 9fc778aab7f5 |
children | 22ab98a06492 |
line wrap: on
line diff
--- a/urwid_satext/sat_widgets.py Sun Oct 02 19:12:40 2011 +0200 +++ b/urwid_satext/sat_widgets.py Sat Oct 08 21:14:41 2011 +0200 @@ -24,6 +24,9 @@ import encodings utf8decode = lambda s: encodings.codecs.utf_8_decode(s)[0] +from urwid.util import is_mouse_press #XXX: is_mouse_press is not include in urwid in 1.0.0 + + class Password(urwid.Edit): """Edit box which doesn't show what is entered (show '*' or other char instead)""" @@ -231,7 +234,7 @@ return key def mouse_event(self, size, event, button, x, y, focus): - if urwid.is_mouse_press(event) and button == 1: + if is_mouse_press(event) and button == 1: self.setState(not self.__selected) return True @@ -865,7 +868,7 @@ def mouse_event(self, size, event, button, x, y, focus): (maxcol,)=size - if urwid.is_mouse_press(event) and button == 1: + if is_mouse_press(event) and button == 1: _prev,_next,start_wid,end_wid,cols_left = self.__calculate_limits(size) if x==0 and _prev: self.keypress(size,'left')