On Mon, Nov 19, 2012 at 2:58 PM, Ian Ward <[email protected]> wrote: > Here's a quick example of a text layout class that displays all text > in a right-to-left manner. It almost,sort-of works with the Edit > widget too: > > https://gist.github.com/4113436
This works by the terrible method of laying out each character one-by-one in the reverse order. StandartTextLayout gives ranges for each line: (column width of text segment, start offset, end offset) This terrible method generates one of these per character, e.g. [(1, 5, 6), (1, 4, 5), (1, 3, 4), (1, 2, 3)] instead of one per line. Real support for right-to-left ranges in text layouts would mean allowing end_offset < start_offset and handling that case in the part of the Text and Edit widgets that consume text layout structures. The example above would become just [(4, 6, 2)]. I apologise about the text layout code, it's some of the older code in the library and hasn't seen much love. Cryptic single-letter variable names are everywhere. At least there *are* some comments. If it's any help "sc" stands for "screen columns". Ian _______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
