pmacs3/render.py

21 lines
617 B
Python
Raw Normal View History

import color
from point import Point
class RenderString(object):
def __init__(self, s, y=0, x=0, attrs=None, name=""):
if attrs is None:
attrs = color.build('default', 'default')
self.string = s
self.y = y
self.x = x
self.attrs = attrs
self.name = name
def draw(self, cwin, y, x):
try:
cwin.addstr(self.y + 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)