1 # Tk backend -- unfinished
9 def __init__(self
, text
):
10 self
.text
= text
# The text widget to draw in
15 # Methods called by htmllib.FormattingParser:
17 def setfont(self
, font
):
18 if 1 or debug
: print "setfont(%s)" % `font`
22 if debug
: print "resetfont()"
26 if debug
: print "flush()"
29 def setleftindent(self
, n
):
30 if debug
: print "setleftindent(%d)" % n
32 def needvspace(self
, n
):
33 if debug
: print "needvspace(%d)" % n
34 self
.blanklines
= max(n
, self
.blanklines
)
37 def addword(self
, word
, nspaces
):
38 if debug
: print "addword(%s, %d)" % (`word`
, nspaces
)
39 if self
.nospace
and not word
:
41 if self
.blanklines
> 0:
42 word
= '\n'*self
.blanklines
+ word
45 here
= self
.text
.index('end')
46 self
.text
.insert('end', word
+ nspaces
*' ')
51 if debug
: print "setjust(%s)" % `c`
54 if debug
: print "bgn_anchor()"
57 if debug
: print "end_anchor()"
60 if debug
: print "hrule()"
62 self
.addword('_'*60, 0)