Friday, July 22, 2011

gnocl::text -markupTags

Extending pango markup string support is something of a challenge. One option that I've just added to the gnocl::text widget is -markupTags. This will specify whether to implement a set of tags corresponding to the 'Convenience Tags' listed in the Gnocl docs. Apart from saving time when scripting, this will allow the parsing of the text buffer for names tags for output of text blocks in pango markup. For example:

$txt insert end "APPLE" -tags {b}

can be parsed and output as:


The same should be possible for span attributes too:

$txt insert end "APPLE" -tags {b fg=r bg=y}

could be parsed and output as:

<span fgcolor="red" bgcolor="yellow"<b>APPLE<\b><\span>

No comments: