[Urwid] Looking for more urwid examples

Ian Ward ian at excess.org
Wed May 10 09:56:30 EDT 2006


Rebecca Breu wrote:
> Zitat von "Farrell, Doug" <DFarrell at ScholasticLibrary.com>:
> 
> 
>>Hi all,
>>
>>I'm looking for more urwid example programs as I'm a little stumped how to
>>proceed to get started using the module. What I'm looking for is an
>>application that would kind of look and feel like the old Borland TurboVision
>>UI system. Somethign with a menubar, drop down selections and the like. I
>>guess I'm just being really dense as I'm stumped getting over the "take the
>>first step" hurdle with urwid.
>>
>>Thanks in advance,
>>Doug
>>
> 
> 
> Hi Doug,
> 
> I attached a simple example that produces a main view. status bar, menu bar,
> pull down menus and a popup dialog. I wrote it down quickly, but I hope it will
> be helpful anyway.
> 
> Rebecca
> 
> 

That's a great example Rebecca.  Do you mind if I post it on the website?

I remember the old TurboVision UI well.. I spent hours and hours in 
Borland C++ some years ago.  It had floating windows that you could drag 
around and resize.  The windows had vertical and horizontal scroll bars. 
There was a menu system with a decent file dialog.  Likely other things 
I've forgotten too.

My focus for Urwid has always been on other styles of console 
applications (vim, mutt, w3m, etc..), so things like a menu system, 
scroll bars, draggable windows and a file dialog are missing in Urwid. 
(Though Rebecca's example shows that you can build a menu pretty easily)

Now that there is mouse support in Urwid I am investigating adding a 
pop-up menu widget and scroll bars.  The pop-up menu could be used by a 
menu bar and option or "combo box" widgets.  The scroll bars are going 
to be an interesting challenge, since the ListBox widget doesn't know 
what the total length of all the widgets it contains.

A file dialog is a big and interesting project all by itself.  If anyone 
wants to have a go at it, I'll happily accept patches.  :-)

Ian




More information about the Urwid mailing list