pmacs3/render.py

18 lines
542 B
Python
Raw Normal View History

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):
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)