def expose_c(self, widget, event): x, y, w, h = self.area_a.get_allocation() self.space_a = CartesianSpace(w, h) x, y, w, h = self.area_c.get_allocation() self.space_c = CartesianSpace(w, h) cr = self.area_c.window.cairo_create() cr.set_source_rgb(0.1, 0.1, 0.8) cr.rectangle(0, 0, w, h) cr.fill() cr.set_line_width(9) cr.set_source_rgb(0.7, 0.2, 0.0) if self.cursor_position_c is not None: cursor_dims = (40, 40) cr.move_to(self.cursor_position_c[0] - cursor_dims[0] / 2, self.cursor_position_c[1]) cr.line_to(self.cursor_position_c[0] + cursor_dims[0] / 2, self.cursor_position_c[1]) cr.move_to(self.cursor_position_c[0], self.cursor_position_c[1] - cursor_dims[1] / 2) cr.line_to(self.cursor_position_c[0], self.cursor_position_c[1] + cursor_dims[1] / 2) cr.stroke()
def draw_b(self, cairo_context): x, y, w, h = self.area_a.get_allocation() padding = (self.padding * w, self.padding * h) self.space_b = CartesianSpace(w - 2 * padding[0], h - 2 * padding[1], offset=(padding[0], padding[1])) cairo_context.rectangle(*(self.space_b._offset + self.space_b.dims)) cairo_context.stroke()