1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-22 05:48:03 +01:00

Support urwid 1.0.0

This commit is contained in:
David Paleino
2011-10-17 22:14:40 +02:00
parent ab80fc76e9
commit 469a85b1b1
2 changed files with 15 additions and 3 deletions

View File

@@ -478,7 +478,11 @@ class Dialog2(urwid.WidgetWrap):
while not keys:
keys = ui.get_input()
for k in keys:
if urwid.is_mouse_event(k):
if urwid.VERSION < (1, 0, 0):
check_mouse_event = urwid.is_mouse_event
else:
check_mouse_event = urwid.util.is_mouse_event
if check_mouse_event(k):
event, button, col, row = k
overlay.mouse_event( size,
event, button, col, row,

View File

@@ -241,7 +241,11 @@ def help_dialog(body):
# Don't stop because someone let go of the mouse on the frame
mouse_release = False
for k in keys:
if urwid.is_mouse_event(k) and k[0] == "mouse release":
if urwid.VERSION < (1, 0, 0):
check_mouse_event = urwid.is_mouse_event
else:
check_mouse_event = urwid.util.is_mouse_event
if check_mouse_event(k) and k[0] == "mouse release":
mouse_release = True
break
if mouse_release :
@@ -883,7 +887,11 @@ class appGUI():
data[4], False)
for k in keys:
if urwid.is_mouse_event(k):
if urwid.VERSION < (1, 0, 0):
check_mouse_event = urwid.is_mouse_event
else:
check_mouse_event = urwid.util.is_mouse_event
if check_mouse_event(k):
event, button, col, row = k
self.frame.mouse_event( self.size,
event, button, col, row,