@deffn Procedure set-gtk-widget-draw-callback! widget callback
Arranges for @var{callback} to be applied to @var{widget} and a cairo
context clipped to the area to be re-drawn.
-@var{Callback} should return @code{#t} or @code{#f} to indicate
-whether the @code{"draw"} signal has been handled(?), else a warning
-is issued.
@end deffn
@deffn Procedure set-gtk-widget-event-callback! widget callback
(C-call "cairo_restore" cr))))
(fix-drawing-display-list drawing)))
(%trace2 ";draw area "x","y" "w"x"h
- " of "layout" (no drawing!).\n"))
- #t)))))
+ " of "layout" (no drawing!).\n")))))))
(define (set-fix-layout-scroll-size! widget width height)
;; Tells WIDGET to adjust its scrollable extent. Notifies any
(C-call "gtk_render_handle" style cr
0. 0.
(->flonum (fix-rect-width geom))
- (->flonum (fix-rect-height geom)))
- #t))
+ (->flonum (fix-rect-height geom)))))
(define (resizer-enter-handler resizer)
(%trace ";resizer-enter-handler\n")
(old-step-incr (f->e (C-call "gtk_adjustment_get_step_increment" alien)))
(old-page-incr (f->e (C-call "gtk_adjustment_get_page_increment" alien))))
(if (not (int:= new-lower old-lower))
- (C-call "gtk_adjustment_set_lower" (->flonum new-lower)))
+ (C-call "gtk_adjustment_set_lower" alien (->flonum new-lower)))
(if (not (int:= new-upper old-upper))
(C-call "gtk_adjustment_set_upper" alien (->flonum new-upper)))
(if (not (int:= new-value old-value))
(C-call "gtk_adjustment_set_value" alien (->flonum new-value)))
(if (not (int:= new-page-size old-page-size))
- (C-call "gtk_adjustment_set_page_size"
- alien (->flonum new-page-size)))
+ (C-call "gtk_adjustment_set_page_size" alien (->flonum
+ new-page-size)))
(if (not (int:= new-step-incr old-step-incr))
(C-call "gtk_adjustment_set_step_increment"
alien (->flonum new-step-incr)))
(define (peek-gtk-adjustment adjustment)
;; For debugging...
- (list
- (C-call "gtk_adjustment_get_lower" adjustment)
- (C-call "gtk_adjustment_get_upper" adjustment)
- (C-call "gtk_adjustment_get_value" adjustment)
- (C-call "gtk_adjustment_get_page_size" adjustment)
- (C-call "gtk_adjustment_get_step_increment" adjustment)
- (C-call "gtk_adjustment_get_page_increment" adjustment)))
+ (let ((alien (gobject-alien adjustment)))
+ (list
+ 'lower (C-call "gtk_adjustment_get_lower" alien)
+ 'upper (C-call "gtk_adjustment_get_upper" alien)
+ 'value (C-call "gtk_adjustment_get_value" alien)
+ 'page-size (C-call "gtk_adjustment_get_page_size" alien)
+ 'step-increment (C-call "gtk_adjustment_get_step_increment" alien)
+ 'page-increment (C-call "gtk_adjustment_get_page_increment" alien))))
\f
;;; GtkWidgets
(define (make-draw-callback callback)
(named-lambda (draw-callback widget cr)
- (let ((handled? (callback widget cr)))
- (cond ((eq? handled? #t) 1)
- ((eq? handled? #f) 0)
- (else (warn "Draw callback not boolean:" callback)
- 0)))))
+ (callback widget cr)
+ ;; This is ignored in _gtk_widget_draw_internal:
+ 1))
(define (set-gtk-widget-event-callback! widget callback)
(guarantee-gtk-widget widget 'set-gtk-widget-event-callback!)