Note
These constants may be used, but using the string values themselves in your program is equally supported. These constants are used internally by urwid just to avoid possible misspelling, but the example programs and tutorials tend to use the string values.
One or more of these values returned by Widget.sizing() to indicate supported sizing methods.
Widget that is given a number of columns by its parent widget and calculates the number of rows it requires for rendering e.g. Text
Used to horizontally align text in Text widgets and child widgets of Padding and Overlay.
Used to vertically align child widgets of Filler and Overlay.
Used to distribute or set widths and heights of child widgets of Padding, Filler, Columns, Pile and Overlay.
Ask the child widget to calculate the number of columns or rows it needs
A set number of columns or rows, e.g. (‘given’, 10) will have exactly 10 columns or rows given to the child widget
A percentage of the total space, e.g. (‘relative’, 50) will give half of the total columns or rows to the child widget
A weight value for distributing columns or rows, e.g. (‘weight’, 3) will give 3 times as many columns or rows as another widget in the same container with (‘weight’, 1).
wrap text on space characters or at the boundaries of wide characters
wrap before any wide or narrow character that would exceed the available screen columns
clip before any wide or narrow character that would exceed the available screen columns ad don’t display the remaining text on the line
Note
There is no way to tell if the user’s terminal has a light or dark color as their default foreground or background, so it is highly recommended to use this setting for both foreground and background when you do use it.
Constants are not defined for these colors.
sent by BaseScreen (and subclasses like raw_display.Screen) when a palette entry is changed. MainLoop handles this signal by redrawing the whole screen.
sent by BaseScreen (and subclasses like raw_display.Screen) when the list of input file descriptors has changed. MainLoop handles this signal by updating the file descriptors being watched by its event loop.
Command names are used as values in CommandMap instances. Widgets look up the command associated with keypresses in their Widget.keypress() methods.
You may define any new command names as you wish and look for them in your own widget code. These are the standard ones expected by code included in Urwid.
Default associated keypress: ‘ctrl l’
MainLoop.process_input() looks for this command to force a screen refresh. This is useful in case the screen becomes corrupted.
Default associated keypresses: ‘ ‘ (space), ‘enter’
Activate a widget such as a Button, CheckBox or RadioButton.
Default associated keypress: ‘up’
Move the cursor or selection up one row.
Default associated keypress: ‘down’
Move the cursor or selection down one row.
Default associated keypress: ‘left’
Move the cursor or selection left one column.
Default associated keypress: ‘right’
Move the cursor or selection right one column.
Default associated keypress: ‘page up’
Move the cursor or selection up one page.
Default associated keypress: ‘page down’
Move the cursor or selection down one page.
Default associated keypress: ‘home’
Move the cursor or selection to the leftmost column.
Default associated keypress: ‘end’
Move the cursor or selection to the rightmost column.