Frequently Asked Questions
How do you pronounce "Urwid"?
Urwid is properly pronounced oor'-wid, from the German prefix "ur" meaning ancestral or primal and "wid" for widget library. (thank you to Rebecca Breu for sharing this interpretation)
When trying the examples why do I get an AttributeError: 'module' object has no attribute 'MainLoop' error?
You are likely running a version of Urwid that does not come with the MainLoop class. You need to download Urwid version 0.9.9 or later to use MainLoop.
import urwid print(urwid.__version__)
How do I create drop-downs, floating windows, and scroll bars? I want to make my console application look like Borland Turbo Vision, because that was awesome!
You need to start writing some fairly complex widgets. This functionality hasn't been added to Urwid yet, but if you are willing to write it, we do accept patches. The example programs, and the contributed example are good places to start.
What does the "AttributeError: XXX object has no attribute 'rows'" error mean?
One of your XXX widgets is being treated like a flow widget by another widget. The rows() method is used to calculate the number of screen rows required to display a flow widget, but box widgets may be displayed with any number of columns and rows. For example, you might have put a box widget in a ListBox or a Filler widget with the wrong arguments.
If you want to use a box widget where a flow widget is expected you need to first wrap it with a widget like BoxAdapter that first imposes a fixed number of rows on a box widget.
What does the "(maxcol,) = size ... ValueError: too many values to unpack" error mean?
One of your flow widgets is being treated like a box widget by another widget or by the MainLoop class. For example, the topmost widget used by the MainLoop class and widgets used the body of a Frame widget must be box widgets.
If you want to use a flow widget where a box widget is expected you need to first wrap is with a widget like Filler that will take care of filling the empty space above or below what the flow widget displays.
When I change a widget's content why doesn't the screen update until I press a key?
Urwid's MainLoop automatically calls draw_screen() after input is handled and after alarm callbacks are called. If you are updating a widget as a result of another asynchronous event you will need to call draw_screen() yourself. See the MainLoop description in the manual.
