Discussion:
[urwid] Overwrite Text Attr with AttrWrap.
Thomas Schüßler
2016-01-06 16:50:11 UTC
Permalink
Hi, I'm trying to get a ListBox working where text items with text
markup should highlight a part of the text (bold).
I can't figure out how to get this working so that the line that has the
focus gets a uniform background color even behind those highlighted
substrings.
Am I missing something here?

Heres an example:
https://gist.github.com/vindolin/98a3b030497e5cfdcb2f

Regards,
Thomas
--
You received this message because you are subscribed to the Google Groups "Urwid Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urwid+***@excess.org.
To post to this group, send email to ***@excess.org.
For more options, visit https://groups.google.com/a/excess.org/d/optout.
Ian Ward
2016-01-06 16:59:04 UTC
Permalink
In your AttrMap use a dict in the last parameter to specify the
mapping you want for things that already have attributes. i.e. instead
of

, 'item_focus')

try:

, {None: 'item_focus', 'highlight': 'highlight_focus'})

You'll need to add that 'highlight_focus' entry to your palette as well.
Hi, I'm trying to get a ListBox working where text items with text markup
should highlight a part of the text (bold).
I can't figure out how to get this working so that the line that has the
focus gets a uniform background color even behind those highlighted
substrings.
Am I missing something here?
https://gist.github.com/vindolin/98a3b030497e5cfdcb2f
Regards,
Thomas
--
You received this message because you are subscribed to the Google Groups
"Urwid Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/a/excess.org/d/optout.
--
You received this message because you are subscribed to the Google Groups "Urwid Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urwid+***@excess.org.
To post to this group, send email to ***@excess.org.
For more options, visit https://groups.google.com/a/excess.org/d/optout.
Thomas Schüßler
2016-01-07 10:43:43 UTC
Permalink
Post by Ian Ward
In your AttrMap use a dict in the last parameter to specify the
mapping you want for things that already have attributes. i.e. instead
of
, 'item_focus')
, {None: 'item_focus', 'highlight': 'highlight_focus'})
You'll need to add that 'highlight_focus' entry to your palette as well.
[...]

(I hope I'm not double posting this, the web form at gmane.org gave me
some errors and after hours there was no post in the list)

Thanks Ian, I knew I missed something :)

For the books, here's the corrected example:
https://gist.github.com/vindolin/cfb01e94302068f07389

And here's the tool I'm working on:
https://github.com/vindolin/selecta/tree/0.0.2

It's the first time I'm using Urwid so I might do things the wrong way
here and there.

Thomas
--
You received this message because you are subscribed to the Google Groups "Urwid Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urwid+***@excess.org.
To post to this group, send email to ***@excess.org.
For more options, visit https://groups.google.com/a/excess.org/d/optout.
Loading...