Quoting Patrick Totzke (2012-12-01 13:01:08)
Post by Patrick Totzke@Ian: I am fumbling around with your NestedTreeWalker. The idea is to allow
ListBox and TreeBox widgets as nodes and to transparently use only their respective walkers
to make a single, outer tree. Keypresses can still be first send to the widgets to make sure
customized keypress method in tree/listBoxes are respected..
This is how far I got:
https://github.com/pazz/urwidtrees/tree/nested
I have trouble debugging this TreeBox stuff.
Its somehow got to do with the way listbox sets its focus..
suggestions?
--------------------
./sandbox.nested.py
Traceback (most recent call last):
File "./sandbox.nested.py", line 30, in <module>
urwid.MainLoop(rootwidget, palette).run() # go
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/main_loop.py", line 272, in run
self.screen.run_wrapper(self._run)
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/raw_display.py", line 242, in run_wrapper
return fn()
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/main_loop.py", line 312, in _run
self.draw_screen()
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/main_loop.py", line 563, in draw_screen
canvas = self._topmost_widget.render(self.screen_size, focus=True)
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/decoration.py", line 225, in render
canv = self._original_widget.render(size, focus=focus)
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/widget.py", line 1751, in render
canv = get_delegate(self).render(size, focus=focus)
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/widget.py", line 141, in cached_render
canv = fn(self, size, focus=focus)
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/listbox.py", line 457, in render
(maxcol, maxrow), focus=focus)
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/listbox.py", line 339, in calculate_visible
self._set_focus_complete( (maxcol, maxrow), focus )
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/listbox.py", line 704, in _set_focus_complete
(maxcol,maxrow), focus)
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/listbox.py", line 674, in _set_focus_first_selectable
(maxcol, maxrow), focus=focus)
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/listbox.py", line 406, in calculate_visible
n_rows = next.rows( (maxcol,) )
File "/home/pazz/.local/lib/python2.7/site-packages/urwid-1.2.0_dev-py2.7-linux-x86_64.egg/urwid/widget.py", line 1761, in <lambda>
rows = property(lambda self:get_delegate(self).rows)
AttributeError: 'ListBox' object has no attribute 'rows'
---------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: signature
Url : http://lists.excess.org/pipermail/urwid/attachments/20121201/11a4e239/attachment.pgp