mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 12:28:08 +01:00
Really fix urwid 1.1.0 compatibility
This commit is contained in:
@@ -352,7 +352,7 @@ class ComboBox(urwid.WidgetWrap):
|
||||
if urwid.VERSION < (1, 1, 0):
|
||||
self.focus = focus
|
||||
else:
|
||||
self.focus_position = focus
|
||||
self._w.focus_position = focus
|
||||
|
||||
self.callback = callback
|
||||
self.user_args = user_args
|
||||
@@ -368,7 +368,10 @@ class ComboBox(urwid.WidgetWrap):
|
||||
if urwid.VERSION < (1, 1, 0):
|
||||
self.focus = index
|
||||
else:
|
||||
self.focus_position = index
|
||||
try:
|
||||
self._w.focus_position = index
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
# API changed between urwid 0.9.8.4 and 0.9.9
|
||||
try:
|
||||
@@ -386,7 +389,7 @@ class ComboBox(urwid.WidgetWrap):
|
||||
if urwid.VERSION < (1, 1, 0):
|
||||
index = self.focus
|
||||
else:
|
||||
index = self.focus_position
|
||||
index = self._w.focus_position
|
||||
|
||||
self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]),
|
||||
attrs=self.attrs,focus_attr=self.focus_attr)
|
||||
@@ -434,7 +437,7 @@ class ComboBox(urwid.WidgetWrap):
|
||||
if urwid.VERSION < (1, 1, 0):
|
||||
return None, self.focus
|
||||
else:
|
||||
return None, self.focus_position
|
||||
return None, self._w.focus_position
|
||||
|
||||
def get_sensitive(self):
|
||||
return self.cbox.get_sensitive()
|
||||
|
||||
Reference in New Issue
Block a user