[Urwid] Rendering standout attribute across entire Columns widget
jacob at sporkexec.com
Tue Sep 6 23:45:47 EDT 2011
So I spent a few nights trying to implement the chaining behavior as discussed.
I didn't get very far with this, because:
- This code isn't the easiest thing to wrap your head around, particularly
when you need to duplicate the behavior with a few added quirks ('*' keys and
appending the attribute).
- Using a dictionary, the logic for '*' and partial keys needs to be in every
Canvas content method AFAICT.
- util._tagmarkup_recurse and I don't get along. I don't exactly understand it's
purpose (I asked about it in my last message) and sparsely documented, but
chances are I just suck too much to understand it.
- I felt like I was going through all kinds of hacky contortions just to barely
make it work.
I got fed up with that, then sat down tonight and did it in about 10 minutes.
The twist is that I did it as a special case of the callable mapping idea I
brought up earlier. It still doesn't address Text markup (you're on your own
there, I've asked for help). IMO this way is pretty clear/simple, though.
Actually I just noticed I haven't done the palette lookup in this branch.
That's pretty easy, I'll get it tonight.
Doing this with raw dictionaries gets very nasty from what I can tell.
More information about the Urwid