In urwid, is there a way for child widgets to change their attributes based on screen redraw actions?
Specifically, if I have a button widget with some very long string:
mybutton = urwid.Button(<some very long string>)
Is there a way for the button to display only part of the string when the terminal is re-sized to a column width less than the length of the string? Equivalent to:
mybutton = urwid.Button(<some very long...>)
As it is now, urwid attempts to wrap the button label, which looks ugly in the context of my interface.
I think the easiest way to achieve this is to implement this behavior as a custom widget, which wraps the vanilla
urwid.Button
but forcing it to render always in only one row -- here is a fully working example:Learn more