class DrawFunction(XorDraw):
    def __init__(self, graph, function):
        XorDraw.__init__(self, graph)
        self.f = Function(self.graph, totalcolor=(55, 255, 255))
        self.f.func = function

    def draw(self, x, y):
        self.f.func.move(x, y)
        self.f.paint()
    def newf(self):
#        ind = self.data.functions.append(id=create_id())
        f = Function(self)
        f.connect('modified', self.on_dataset_modified)
        f.func.connect('modified', self.on_dataset_modified)
        f.func.connect('add-term', self.on_dataset_modified)
        f.func.connect('remove-term', self.on_dataset_modified)
        self.functions.append(f)
        self.emit('add-function', f)
        return f
 def __init__(self, graph, function):
     XorDraw.__init__(self, graph)
     self.f = Function(self.graph, totalcolor=(55, 255, 255))
     self.f.func = function