Quoting Ian Ward (2012-12-02 01:37:13)
> On Sat, Dec 1, 2012 at 8:50 AM, Patrick Totzke <[email protected]> 
> wrote:
> > Quoting Patrick Totzke (2012-12-01 13:01:08)
> >> @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
> ...
> > AttributeError: 'ListBox' object has no attribute 'rows'
> > ---------------------------------------------------------------
> 
> ListBoxes as widgets within other ListBoxes really can't work well.
> 
>   AttributeError: 'ListBox' object has no attribute 'rows'
> ^that means a wiget (ListBox) is being treated as a flow widget when
> it doesn't support that.

I wonder why it is treated as a widget!
In my proposal, a NestedTreeWalker detects if a widget is ListBox or TreeBox
and returns its interna accordingly, never the widget itself..
The idea is that you use `isinstance` a lot to transparently
use internal walker (the way you did before) only.
From a users point of view this looks exactly like stacking list/treeboxes..

/p

Attachment: signature.asc
Description: signature

_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid

Reply via email to