问题
I am trying to make a 1D console application using Urwid for displaying a user editable application form as shown below.
_________________________
| Application Form |
| ---------------- |
| ' ' |
| ' ' |
| ---------------- |
| |
| ---------------- |
| ' --------- ' |
| ' ' ' ' |
| ' --------- ' |
| ' ' |
| ---------------- |
| |
|_________________________|
Consider the outer rectangle as one window or widget that contains the header title "Application Form" and other smaller windows inside it. The smaller windows or widgets can contain other windows.
In each of the smaller windows, some text along with some buttons for user editing needs to be displayed. Which of the container widgets from among the following, available from Urwid library, can be recommended to use that will allow me vertical scrolling? Pile, LineBox, ,Frame, ListBox, or AttrMap.
Keep in mind that I need vertical scrolling as my outermost rectangle or window will not fit in the standard screen.
回答1:
Look at the examples that come with Urwid, especially examples/tour.py
. That one demonstrates many of Urwid’s widgets and containers in a large, scrollable container and should give you plenty of ideas. The whole examples
directory exists for this very reason.
Also, Urwid has only a small number of containers. You could have just, you know, tried them out…
来源:https://stackoverflow.com/questions/17846930/required-widgets-for-displaying-a-1d-console-application