wok view wicd/stuff/831_830.patch @ rev 25524
created recipes for tree-sitter and tree-sitter-dev 0.20.7
author | Hans-G?nter Theisgen |
---|---|
date | Fri Feb 24 17:21:52 2023 +0100 (21 months ago) |
parents | |
children |
line source
1 === modified file 'curses/curses_misc.py'
2 --- curses/curses_misc.py 2012-05-06 15:16:15 +0000
3 +++ curses/curses_misc.py 2012-11-15 09:26:21 +0000
4 @@ -349,7 +349,10 @@
5 # We need this to pick our keypresses
6 self.use_enter = use_enter
8 - self.focus = focus
9 + if urwid.VERSION < (1, 1, 0):
10 + self.focus = focus
11 + else:
12 + self.focus_position = focus
14 self.callback = callback
15 self.user_args = user_args
16 @@ -362,7 +365,11 @@
17 self.list = list
19 def set_focus(self,index):
20 - self.focus = index
21 + if urwid.VERSION < (1, 1, 0):
22 + self.focus = index
23 + else:
24 + self.focus_position = index
25 +
26 # API changed between urwid 0.9.8.4 and 0.9.9
27 try:
28 self.cbox.set_w(SelText(self.list[index]+self.DOWN_ARROW))
29 @@ -376,16 +383,21 @@
30 def build_combobox(self,parent,ui,row):
31 str,trash = self.label.get_text()
33 - self.cbox = DynWrap(SelText([self.list[self.focus]+self.DOWN_ARROW]),
34 + if urwid.VERSION < (1, 1, 0):
35 + index = self.focus
36 + else:
37 + index = self.focus_position
38 +
39 + self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]),
40 attrs=self.attrs,focus_attr=self.focus_attr)
41 if str != '':
42 w = urwid.Columns([('fixed',len(str),self.label),self.cbox],
43 dividechars=1)
44 - self.overlay = self.ComboSpace(self.list,parent,ui,self.focus,
45 + self.overlay = self.ComboSpace(self.list,parent,ui,index,
46 pos=(len(str)+1,row))
47 else:
48 w = urwid.Columns([self.cbox])
49 - self.overlay = self.ComboSpace(self.list,parent,ui,self.focus,
50 + self.overlay = self.ComboSpace(self.list,parent,ui,index,
51 pos=(0,row))
53 self._w = w
54 @@ -419,7 +431,10 @@
55 if self.overlay:
56 return self.overlay._listbox.get_focus()
57 else:
58 - return None,self.focus
59 + if urwid.VERSION < (1, 1, 0):
60 + return None, self.focus
61 + else:
62 + return None, self.focus_position
64 def get_sensitive(self):
65 return self.cbox.get_sensitive()