2008-04-20 23:10:25 -04:00
|
|
|
import color
|
|
|
|
from point import Point
|
|
|
|
|
|
|
|
class RenderString(object):
|
|
|
|
def __init__(self, s, x=0, attrs=None):
|
|
|
|
if attrs is None:
|
|
|
|
attrs = color.build('default', 'default')
|
|
|
|
self.string = s
|
|
|
|
self.x = x
|
|
|
|
self.attrs = attrs
|
|
|
|
def draw(self, cwin, y, x):
|
2008-04-25 10:20:40 -04:00
|
|
|
try:
|
|
|
|
cwin.addstr(y, self.x + x, self.string, self.attrs)
|
|
|
|
except:
|
|
|
|
#return
|
|
|
|
raise Exception, "cwin.addstr(%d, %d + %d, %r, %r) failed" % \
|
|
|
|
(y, self.x, x, self.string, self.attrs)
|