[Urwid] Resizing windows in urwid: how small is too small?

James Reeves jreeves at monkeyengines.co.uk
Tue May 8 16:06:08 EDT 2007

Hi there,

I've been playing around with urwid, and it's just about the best 
console UI I've ever run across. However, in the midst of my experiments 
with 0.9.8, I discovered that if one attempts to render a widget on a 
small enough area, an exception is thrown, and the application exits. 
The SVN version fairs better, as it is only when one tries to render a 
widget on a canvas of zero area does an assertion fail. This works well 
enough for single widgets, but problems still occur when one has 
multiple widgets grouped together, such as with a Pile. For instance, if 
I have a Pile of 8 widgets, and then try to resize the window to a 
height of 7, one of those widgets will have to have a height of zero, 
which will cause the program to exit with an assertion failure.

The solution, I expect, would be to allow canvases of zero area to be 
rendered; or perhaps for container widgets (such as Columns, Piles, 
Frames etc.) not to render any widget if its size has a 0 in the width 
or height column. This is based on the principle that even if the user 
shrinks down the terminal window to such a small size that he cannot 
even see half the widgets, it is better to keep the program running and 
not to show those widgets, then to panic and exit the application.

Are there any plans to implement such a change already? Or is there any 
reason why this is a really bad idea?

 James Reeves

More information about the Urwid mailing list