0

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
tauseef_CuriousGuy
  • 770
  • 1
  • 12
  • 28
  • 1
    Wow, that's quite heavy to answer… why not post what you've done so far and let us make some small tweaks instead of making us writing for you the whole program? :) – Bogey Jammer Jul 28 '13 at 19:57
  • @Bogey You won't be disappointed. I have some code that does something. Refer this question [http://stackoverflow.com/questions/17910768/command-prompt-messed-up-after-running-a-python-program] I have a separate piece of code wherein I have played around with reading my yml file and extracting ordered dictionaries from it. But right now I am stuck with the above question. The code at this question contains a function formLayout which modifies a global screen handle ui. – tauseef_CuriousGuy Jul 28 '13 at 20:41

1 Answers1

2

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…