Discussion:
[urwid] Redrawing Buttons in a Pile
hihn
2016-10-26 19:01:04 UTC
Permalink
Hello there,

I got a Pile of multiple Buttons and I would like to modify this.
For example, I would like to add/remove Buttons from this Pile dynamically
or change their label.

How would I do this?

Greetings
--
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.
Ian Ward
2016-10-26 19:47:24 UTC
Permalink
forgot to reply-all :-/
You can update a Pile's contents by modifying the pile.contents
list-like attribute, as documented in
http://urwid.org/manual/widgets.html#container-widgets
e.g.
pile.contents.append((Button(...), pile.options())
del pile.contents[0]
for accessing a button (even if it's wrapped in a AttrMap or simliar)
pile[0].set_label(u'my new label')
Post by hihn
Hello there,
I got a Pile of multiple Buttons and I would like to modify this.
For example, I would like to add/remove Buttons from this Pile dynamically
or change their label.
How would I do this?
Greetings
--
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
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.
Loading...