Name
tag_config
Synopsis
t.tag_config(tag,**tag_options)Sets or changes tag options associated with tag
tag, determining the way
t renders text in
tag’s region. The most
frequently used tag options are:
-
background,foreground Background and foreground colors
-
bgstipple,fgstipple Background and foreground stipples, typically '
gray12', 'gray25', 'gray50', or 'gray75'; by default, solid colors (no stippling)-
borderwidth Width in pixels of the text border; default is
0(no border)-
font Font used for text in the tag’s ranges (see Section 16.6.6 later in this chapter)
-
justify Text justification,
LEFT(default),CENTER, orRIGHT-
lmargin1,lmargin2,rmargin Left margin (first line, other lines) and right margin (all lines), in pixels; default is
0(no margin)-
offset Offset from baseline in pixels (greater than
0for superscript, less than0for subscript); default is0(no offset, i.e., text aligned with the baseline)-
overstrike If true, draw a line right over the text
-
relief Text relief:
FLAT(default),SUNKEN,RAISED,GROOVE, orRIDGE-
spacing1,spacing2,spacing3 Extra spacing in pixels (before first line, between lines, after last line); default is
0(no extra spacing)-
underline If true, draw a line under the text
-
wrap Wrapping mode:
WORD(default),CHAR, orNONE
For example:
t.tag_config(SEL,background='black',foreground='yellow')
tells t to display
t’s selected range with
yellow text on a black background.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access