[Urwid] problems with overlay widget

zerx at prochas.net zerx at prochas.net
Tue May 22 02:32:59 EDT 2007

Ian Ward writes:

> zerx at prochas.net wrote:
>> i have some problems getting an overlay widget to work.
>> can you help me please and have a quick look at the following code?
>> this is the error if i press 'h' which triggers the code:
>> "ValueError: need more than 1 value to unpack"
>> i looked at the examples but didn't find any hint why my code doesn't 
>> work but
>> the example's one does.
> Hello,
> Your problem is here:
>> 		# help overlay message
>> 		# FIXME: overlay funktioniert ned.
>> 		help = urwid.Text('Help\n----\n"h"\t ... this help screen\n"ESC"\t ... exit this help screen\n"ALT+q"\t ... exit the programm', align='center')
>> 		help = urwid.AttrWrap(help, 'help')
>> 		help = urwid.Overlay(help, topframe, 'center', None, 'middle', None)
>> 		#help = urwid.Overlay(help, topframe, 'center', 1, 'middle', None)
> You are putting a flow widget (Text) inside an Overlay.  The overlay is 
> expecting a fixed widget because your width and height are set to None.
> What you are trying to do will probably work in a future release of 
> Urwid, I just haven't gotten around to implementing the ability for Text 
> to behave like a fixed widget yet.  I guess I should get to work on 
> that! :-)
> You need to:
> 1. set a value for width and height in your Overlay, so that it expects 
> a box widget
> 2. wrap your Text widget in a Filler widget, which is a box widget.
> This means that it won't intelligently resize based on your text for 
> now, but that's the best option I can see at the moment.
> Ian

works perfekt ...
thank you!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.excess.org/pipermail/urwid/attachments/20070522/73766085/attachment.pgp 

More information about the Urwid mailing list