fix canvas% refresh for Gtk

This commit is contained in:
Matthew Flatt 2010-06-12 10:50:16 -06:00
parent 0709870ef9
commit 1aab1c78a3
3 changed files with 6 additions and 2 deletions

View File

@ -20,6 +20,8 @@
(define-gtk gtk_drawing_area_new (_fun -> _GtkWidget)) (define-gtk gtk_drawing_area_new (_fun -> _GtkWidget))
(define-gtk gtk_widget_queue_draw (_fun _GtkWidget -> _void))
(define-gtk gtk_hbox_new (_fun _gboolean _int -> _GtkWidget)) (define-gtk gtk_hbox_new (_fun _gboolean _int -> _GtkWidget))
(define-gtk gtk_hscrollbar_new (_fun _pointer -> _GtkWidget)) (define-gtk gtk_hscrollbar_new (_fun _pointer -> _GtkWidget))
(define-gtk gtk_vscrollbar_new (_fun _pointer -> _GtkWidget)) (define-gtk gtk_vscrollbar_new (_fun _pointer -> _GtkWidget))
@ -169,6 +171,9 @@
(define/public (on-paint) (void)) (define/public (on-paint) (void))
(define/override (refresh)
(gtk_widget_queue_draw client-gtk))
(define/override (internal-on-client-size w h) (define/override (internal-on-client-size w h)
(send dc reset-dc-size)) (send dc reset-dc-size))

View File

@ -40,7 +40,6 @@
(values (exact->inexact (send bm get-width)) (values (exact->inexact (send bm get-width))
(exact->inexact (send bm get-height)))) (exact->inexact (send bm get-height))))
(define last-y -1)
(def/public (set-pixel [real? x][real? y][color% c]) (def/public (set-pixel [real? x][real? y][color% c])
(let ([s (bytes 255 (color-red c) (color-green c) (color-blue c))]) (let ([s (bytes 255 (color-red c) (color-green c) (color-blue c))])
(set-argb-pixels x y 1 1 s))) (set-argb-pixels x y 1 1 s)))

View File

@ -263,7 +263,7 @@
[o2 (cairo_font_options_create)]) [o2 (cairo_font_options_create)])
(when o (when o
(cairo_font_options_copy o2 o)) (cairo_font_options_copy o2 o))
(cairo_font_options_set_antialias (cairo_font_options_set_antialias
o2 o2
(case (dc-adjust-smoothing smoothing) (case (dc-adjust-smoothing smoothing)
[(default) CAIRO_ANTIALIAS_SUBPIXEL] ; should be DEFAULT? [(default) CAIRO_ANTIALIAS_SUBPIXEL] ; should be DEFAULT?