comparison frontends/primitivus/xmlui.py @ 149:3c3f70c01333

Primitivus: wix: xmlui misc fixes
author Goffi <goffi@goffi.org>
date Wed, 28 Jul 2010 19:56:56 +0800
parents 80661755ea8d
children b1f1955d96b3
comparison
equal deleted inserted replaced
148:1d74c59a36a9 149:3c3f70c01333
35 35
36 def append(self, widget): 36 def append(self, widget):
37 pile = self._w.widget_list[self.idx] 37 pile = self._w.widget_list[self.idx]
38 if pile.__class__ == urwid.Text: 38 if pile.__class__ == urwid.Text:
39 self._w.widget_list[self.idx] = urwid.Pile([widget]) 39 self._w.widget_list[self.idx] = urwid.Pile([widget])
40 if self.idx == 1:
41 self._w.set_focus(1)
40 else: 42 else:
41 pile.widget_list.append(widget) 43 pile.widget_list.append(widget)
42 pile.item_types.append(('weight',getattr(self,'weight_'+str(self.idx)))) 44 pile.item_types.append(('weight',getattr(self,'weight_'+str(self.idx))))
43 self.idx = (self.idx + 1) % 2 45 self.idx = (self.idx + 1) % 2
44 46
68 if type=="empty": 70 if type=="empty":
69 ctrl = urwid.Text('') 71 ctrl = urwid.Text('')
70 elif type=="text": 72 elif type=="text":
71 try: 73 try:
72 value = elem.childNodes[0].wholeText 74 value = elem.childNodes[0].wholeText
73 except KeyError: 75 except IndexError:
74 warning (_("text node has no child !")) 76 warning (_("text node has no child !"))
75 ctrl = urwid.Text(value) 77 ctrl = urwid.Text(value)
76 elif type=="label": 78 elif type=="label":
77 ctrl = urwid.Text(value+": ") 79 ctrl = urwid.Text(value+": ")
78 elif type=="string": 80 elif type=="string":