Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
145 views
in Technique[技术] by (71.8m points)

python - Required widgets for displaying a 1D console application

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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…


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...