diff 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
line wrap: on
line diff
--- a/frontends/primitivus/xmlui.py	Wed Jul 28 19:56:12 2010 +0800
+++ b/frontends/primitivus/xmlui.py	Wed Jul 28 19:56:56 2010 +0800
@@ -37,6 +37,8 @@
         pile = self._w.widget_list[self.idx]
         if pile.__class__ == urwid.Text:
             self._w.widget_list[self.idx] = urwid.Pile([widget])
+            if self.idx == 1:
+                self._w.set_focus(1)
         else:
             pile.widget_list.append(widget)
             pile.item_types.append(('weight',getattr(self,'weight_'+str(self.idx))))
@@ -70,7 +72,7 @@
             elif type=="text":
                 try:
                     value = elem.childNodes[0].wholeText
-                except KeyError:
+                except IndexError:
                     warning (_("text node has no child !"))
                 ctrl = urwid.Text(value)
             elif type=="label":