def with_canvas(self, proc): hadj, vadj = self._gtk_adjustments() clip = rect_sized((hadj.value, vadj.value), self.size) # canvas = Canvas._from_gdk_drawable(self._gtk_inner_widget.bin_window) context = Gdk.cairo_create(self._gtk_inner_widget.get_bin_window()) self._gtk_prepare_cairo_context(context) canvas = Canvas._from_cairo_context(context) proc(canvas)
def with_canvas(self, proc): hadj, vadj = self._gtk_adjustments() clip = rect_sized((hadj.value, vadj.value), self.size) # canvas = Canvas._from_gdk_drawable(self._gtk_inner_widget.bin_window) context = Gdk.cairo_create(self._gtk_inner_widget.get_bin_window()) self._gtk_prepare_cairo_context(context) canvas = Canvas._from_cairo_context(context) proc(canvas)
def _gtk_draw_signal(self, context): try: self._gtk_prepare_cairo_context(context) clip = context.clip_extents() canvas = Canvas._from_cairo_context(context) self.draw(canvas, clip) except: print "------------------ Exception while drawing ------------------" traceback.print_exc()
def _gtk_draw_signal(self, context): try: self._gtk_prepare_cairo_context(context) clip = context.clip_extents() canvas = Canvas._from_cairo_context(context) self.draw(canvas, clip) except: print "------------------ Exception while drawing ------------------" traceback.print_exc()
def draw_page(_, gtk_print_context, page_num): cairo_context = gtk_print_context.get_cairo_context() canvas = Canvas._from_cairo_context(cairo_context) paginator.draw_page(canvas, page_num)
def draw_page(_, gtk_print_context, page_num): cairo_context = gtk_print_context.get_cairo_context() canvas = Canvas._from_cairo_context(cairo_context) paginator.draw_page(canvas, page_num)