[Urwid] LineBox with title

Michal Vyskocil michal.vyskocil at gmail.com
Tue Aug 7 04:02:37 EDT 2007


Hi,

I'd like to have a LineBox with text title, like this

----- urwid 0.9.8.1 -------

Hovever I'm not very familiar with this library (I've founded it yesterday 
morning :) and I cannot find anything helpfull in documentation to resolve my 
issue. So I've modified the LineBox class to produce (an optional) title in 
line box.

New __init__ is

__init__(w, title=None, align='center')

And usage

LineBox(widget, Text(urf8decode('urwid 0.9.8.1')), align='center')

But in traditional GUI there's also radio button lists with frame, which has a 
title in left align ...

then LineBox(widget, Text(urf8decode('urwid 0.9.8.1')), align='align') will 
produce

- urwid 0.9.8.1 ------------

I hope, that this path will be useful

BTW: A file line_test.py is modified Conversation object from urwid tutorial, 
which I've used to test of my changes. Lets place it into the same directory, 
as graphics.py.

-- 
best regards
Michal Vyskocil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linebox-title.diff
Type: text/x-diff
Size: 1617 bytes
Desc: not available
Url : http://lists.excess.org/pipermail/urwid/attachments/20070807/5fdeb850/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: line_test.py
Type: application/x-python
Size: 2723 bytes
Desc: not available
Url : http://lists.excess.org/pipermail/urwid/attachments/20070807/5fdeb850/attachment-0001.bin 


More information about the Urwid mailing list