Here you go:
#!/usr/bin/env python
#-*- coding: utf8 -*
import urwid.curses_display
import urwid
ui = urwid.curses_display.Screen()
ui.register_palette( [
('banner', 'black', 'light gray', ('standout', 'underline')),
] )
def run():
cols, rows = ui.get_cols_rows()
canvases = []
canvases.append((urwid.TextCanvas(text=["Entry1"],
attr=[[('banner', cols)]],
maxcol=cols), 0, False))
canvases.append((urwid.TextCanvas(text=["Entry2"],
attr=[[('banner', cols)]],
maxcol=cols), 1, False))
canvases.append((urwid.TextCanvas(text=["НЕЧТО"],
attr=[[('banner', cols)]],
maxcol=cols), 2, False))
combined = urwid.CanvasCombine(canvases)
composite = urwid.CompositeCanvas(combined)
composite.pad_trim_top_bottom(0, rows - len(canvases))
ui.draw_screen( (cols, rows), composite)
while not ui.get_input():
pass
ui.run_wrapper( run )
----
Third entry text is cyrillic but you can use any multibyte string
(I've tried chinese) as well.
The panel has a rather complicated layout which uses different canvas
combination functions, that's why I use canvases instead of just
Text()
2009/7/21 Ian Ward <[email protected]>:
>>
> Looks like a bug. Can you post a short example program that causes the
> problem?
>
> It's not common to assemble the canvases yourself. It's usually easier
> to use Text widgets, even if you just use them to create the Canvas. If
> you post some code I may be able to make a suggestion.
--
~syhpoon
_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid