Robert Nesius
2015-12-27 04:16:21 UTC
Hello,
I have a list-box UI widget working... the idea is the user scrolls through
the menu, makes his or her choice, and off we go.
I have this working with a widget structure like so:
Padding
ListBox
ListWalker
Text
Divider
Button1
Button2
Button3
I start out by adding the five list items into a generic python list, then
give that to ListWalker, the results of which I give to ListBox, then wrap
with padding, hand to an overlay and off I go. Everything works.
But I don't like that in part because when handling moving the focus around
with tab/shift-tab, I have to constantly account for the text widget and
divider when calculating next focus position so I don't set the focus to
either of those two widgets. But no matter how I try to do this
Padding
Pile
Text
Divider
ListBox
ListWalker
Button1
Button2
Button3
But I get the above mentioned error. It struck me that the issue might be
just giving a list to the Pile object is causing problems, so I tried....
Padding
Pile
ListWalker
Text
Divider
ListBox
ListWalker
Button1
Button2
Button3
And that did in fact make the error go away, but another error occurred -
the render loop blew up complaining about too many items to unpack or
something like that.
I also tried the following (and some variations thereof):
Padding
Pile
ListWalker
Text
Divider
ListBox
Pile
Button1
Button2
Button3
That blows up too.
Feels like there is something I'm not conceptually understanding about
layouts in urwid at a fundamental level... so reaching out for advice. I
can follow up with some listings if that would help - thought it feels like
the problem is a conceptual misunderstanding of the rules for gluing these
widgets together.
Thanks in advance! :)
-Rob
I have a list-box UI widget working... the idea is the user scrolls through
the menu, makes his or her choice, and off we go.
I have this working with a widget structure like so:
Padding
ListBox
ListWalker
Text
Divider
Button1
Button2
Button3
I start out by adding the five list items into a generic python list, then
give that to ListWalker, the results of which I give to ListBox, then wrap
with padding, hand to an overlay and off I go. Everything works.
But I don't like that in part because when handling moving the focus around
with tab/shift-tab, I have to constantly account for the text widget and
divider when calculating next focus position so I don't set the focus to
either of those two widgets. But no matter how I try to do this
AttributeError: 'list' object has no attribute 'render'
My latest attempt at this had a widget structure of:Padding
Pile
Text
Divider
ListBox
ListWalker
Button1
Button2
Button3
But I get the above mentioned error. It struck me that the issue might be
just giving a list to the Pile object is causing problems, so I tried....
Padding
Pile
ListWalker
Text
Divider
ListBox
ListWalker
Button1
Button2
Button3
And that did in fact make the error go away, but another error occurred -
the render loop blew up complaining about too many items to unpack or
something like that.
I also tried the following (and some variations thereof):
Padding
Pile
ListWalker
Text
Divider
ListBox
Pile
Button1
Button2
Button3
That blows up too.
Feels like there is something I'm not conceptually understanding about
layouts in urwid at a fundamental level... so reaching out for advice. I
can follow up with some listings if that would help - thought it feels like
the problem is a conceptual misunderstanding of the rules for gluing these
widgets together.
Thanks in advance! :)
-Rob
--
You received this message because you are subscribed to the Google Groups "Urwid Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urwid+***@excess.org.
To post to this group, send email to ***@excess.org.
For more options, visit https://groups.google.com/a/excess.org/d/optout.
You received this message because you are subscribed to the Google Groups "Urwid Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urwid+***@excess.org.
To post to this group, send email to ***@excess.org.
For more options, visit https://groups.google.com/a/excess.org/d/optout.