Discussion:
[Urwid] some general questions on urwid widgets
SHAIKH TAUSEEF HUSSAIN
2013-08-03 16:32:52 UTC
Permalink
I have some basic questions on widgets in urwid.
1. How is AttrMap different from AttrWrap ?
2. How is Pile different from ListBox ?
3. Do flow widgets have attribute/rows or box widgets have attribute rows ?
4. Are attributes same as methods ?
5. How can we place widgets, that have attribute rows, inside widgets that
don't have rows ?
6. Which widgets have append ?
7. When to use SimpleListWalker and when to use SimpleFocusListWalker ?
8. What is selectability and which widgets are selectable ?
9. Is ListBox a box widget ?
--
Kind Regards
Tauseef Hussain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20130803/154f9056/attachment.htm
Ian Ward
2013-08-04 19:02:46 UTC
Permalink
On Sat, Aug 3, 2013 at 12:32 PM, SHAIKH TAUSEEF HUSSAIN
Post by SHAIKH TAUSEEF HUSSAIN
I have some basic questions on widgets in urwid.
1. How is AttrMap different from AttrWrap ?
AttrWrap was the older widget that did a similar thing, but was less
flexible and had the misfeature of passing all attribute lookups to
the wrapped widget.
Post by SHAIKH TAUSEEF HUSSAIN
2. How is Pile different from ListBox ?
ListBox support scrolling through potentially unlimited contents with
the help of a list walker. Pile doesn't support scrolling at all.

ListBox always contains flow widgets and are always box widgets.
Post by SHAIKH TAUSEEF HUSSAIN
3. Do flow widgets have attribute/rows or box widgets have attribute rows ?
What are attribute rows? do you mean the rows() method? Flow widgets
need a rows() method.
Post by SHAIKH TAUSEEF HUSSAIN
4. Are attributes same as methods ?
In Python methods are accessed the same way as attributes, yes.
Post by SHAIKH TAUSEEF HUSSAIN
5. How can we place widgets, that have attribute rows, inside widgets that
don't have rows ?
Is this a flow widget vs. box widget question? See the faq:
https://excess.org/urwid/wiki/FrequentlyAskedQuestions

I plan to make this error message much clearer in a future version of Urwid.
Post by SHAIKH TAUSEEF HUSSAIN
6. Which widgets have append ?
No widgets have append, but you might mean .contents.append(). This
might help: https://excess.org/urwid/docs/manual/widgets.html#container-widgets
Post by SHAIKH TAUSEEF HUSSAIN
7. When to use SimpleListWalker and when to use SimpleFocusListWalker ?
The only difference is the latter automatically updates the focus when
items are removed or inserted before the current index.
Post by SHAIKH TAUSEEF HUSSAIN
8. What is selectability and which widgets are selectable ?
Please see https://excess.org/urwid/docs/reference/widget.html#urwid.Widget.selectable
Post by SHAIKH TAUSEEF HUSSAIN
9. Is ListBox a box widget ?
Yes. Always.

Ian

Loading...