[Urwid] Patch: Text.pack() fails with multi-line strings
Ian Ward
ian at excess.org
Mon Sep 18 09:53:55 EDT 2006
Graham Clinch wrote:
> Hi List,
>
> I'm having some problems using a Text instance's pack method to get the
> screen columns a multi-line string will display as. I've stuck a short
> example that demonstrates this problem for me at the end of the email.
>
> It looks as though there's an off-by-one error in the special-case
> handling of '\n' in strings, and I believe the fix is to apply the
> following patch:
Yes, your patch looks correct. Thanks!
I only recently added pack() with the intent of creating a menu bar and
drop-down widget, but I haven't done much testing yet. There may be
more bugs lurking in that code :-)
I'm wrestling with the more general question of how to design an
interface for asking widgets "how big would you like to be?" I hope I
got it right, but if not the pack() function might change slightly in
future versions.
Ian
More information about the Urwid
mailing list