[Urwid] Completely changing listbox contents
Mariusz.Kruk at epsilon.eu.org
Tue Jul 20 16:03:18 EDT 2010
On Tue, Jul 20, 2010 at 08:20:18PM +0500, Muhammad Ammar wrote:
> check the browse.py example at following link
> and source code here
Thanks for hint but I think I wasn't specific enough with my questions.
The problem is that I want to keep the design "as objective" as possible
meaning I want to delegate as few things outside my objects as possible.
So the natural solution would be to wrap every directory/file object
into a directory or file widget and run apropriate methods from those
widgets. But this leaves me with no way to "cleanly" operate on the
listbox contents unless I'm missing something.
Another approach (which I think you might be suggesting) would be to do
something similar to fib.py example - create widgets on the fly when
apropriate methods in listwalker are called. Its not a bad idea in
itself but it gives me an impression of unnecessary complexity and the
idea of creating and destroying unnecessarily all the time feels a
So I'm looking for another ways of solving this problem.
I know that I always can make a function outside of the
list/listwalker/widgets code that would just update the list contents
and call this function when apropriate keys are pressed but that's not
what I'm looking for.
I hope I made myself a bit more clear this time. :-)
`b Kruk at epsilon.eu.org d'
d' http://epsilon.eu.org/ Yb
More information about the Urwid