2

urwid有许多不同的小部件允许显示文本,以及一些将文本格式化为窗口大小的方法。如何格式化小部件的文本以换行第一行并截断第二行?再具体一点:

`a rather long string that is wrapped on the first line and clipped on the second'

           (window boundary)
|-------------------------------------|
|a rather long string that is wrapped |
|on the first line and clipped on t...|
|-------------------------------------|

当然,这可以通过计算字符来手动完成,但这会很快变得丑陋,尤其是。与窗口大小调整。

4

0 回答 0