(define-generic fix-widget-realize-callback (widget))
-(define-integrable (widget-style-context widget)
- (let ((style (make-alien '|GtkStyleContext|)))
- (C-call "gtk_widget_get_style_context" style (gobject-alien widget))
- style))
-
(define-method fix-widget-realize-callback ((widget <fix-widget>))
(%trace "; (fix-widget-realize-callback <fix-widget>) "widget"\n")
(let ((geometry (fix-widget-geometry widget))
(error-if-null main-GdkWindow "Could not create main window:" widget)
(C-call "gtk_widget_set_window" GtkWidget main-GdkWindow)
(C-call "gdk_window_set_user_data" main-GdkWindow GtkWidget)
- (%trace "; window: "main-GdkWindow"\n"))
-
- #;(let ((style (widget-style-context widget)))
- (C-call "gtk_style_context_add_class" style "view")
- (C-call "gtk_style_context_set_background" style main-GdkWindow))
- (let ((rgba (malloc (C-sizeof "GdkRGBA") '|GdkRGBA|)))
- (C->= rgba "GdkRGBA red" 1.0)
- (C->= rgba "GdkRGBA green" 1.0)
- (C->= rgba "GdkRGBA blue" 1.0)
- (C->= rgba "GdkRGBA alpha" 1.0)
- (C-call "gdk_window_set_background_rgba" main-GdkWindow rgba)
- (free rgba))
-
- unspecific))
+ (%trace "; window: "main-GdkWindow"\n"))))
(define (allocate-callback widget GtkAllocation)
(let ((x (C-> GtkAllocation "GtkAllocation x"))
((= type (C-enum "GDK_2BUTTON_PRESS")) 'DOUBLE-PRESS)
((= type (C-enum "GDK_3BUTTON_PRESS")) 'TRIPLE-PRESS)
(else 'BOGUS)))
+
+(define-method set-gtk-widget-bg-color! ((widget <fix-widget>) color
+ #!optional state)
+ (call-next-method widget color state)
+ (%trace "; (set-gtk-widget-bg-color! <fix-layout>) "widget" "color" "state"\n")
+ (if (not (or (default-object? state) (eq? state 'normal)))
+ (warn "Fix-widget states are not (yet) supported:" widget color state))
+ (let ((style (gtk-widget-style-context widget)))
+ (C-call "gtk_style_context_set_background"
+ style (fix-widget-window widget))))
\f
(define-class (<fix-layout> (constructor () (width height)))
(<fix-widget>)
" of "layout" (no drawing!).\n"))))
1))) ;; handled
-(define-method set-gtk-widget-bg-color! ((widget <fix-layout>) color
- #!optional state)
- (call-next-method widget color state)
- (%trace "; (set-gtk-widget-bg-color! <fix-layout>) "widget" "color" "state"\n")
- (if (not (or (default-object? state) (eq? state 'normal)))
- (warn "Fix-layout states are not (yet) supported:" widget color state)))
-
(define (set-fix-layout-scroll-size! widget width height)
;; Tells WIDGET to adjust its scrollable extent. Notifies any
;; scrollbars.
(define (resizer-draw-callback resizer cr)
(let ((geom (fix-widget-geometry resizer))
- (style (widget-style-context resizer)))
+ (style (gtk-widget-style-context resizer)))
(C-call "gtk_render_handle" style cr
(->flonum (fix-rect-x geom))
(->flonum (fix-rect-y geom))
(%trace2 ";drawing "ink" on "widget"\n")
(let ((view (fix-layout-view widget))
(extent (fix-ink-extent ink))
- (style (widget-style-context widget)))
+ (style (gtk-widget-style-context widget)))
(let ((x (->flonum (fix:- (fix-rect-x extent) (fix-rect-x view))))
(y (->flonum (fix:- (fix-rect-y extent) (fix-rect-y view))))
(width (->flonum (fix-rect-width extent)))
(height (->flonum (fix-rect-height extent))))
(C-call "gtk_render_background" style cr x y width height)
- (C-call "gtk_render_frame" style cr x y width height))))
+ (C-call "gtk_render_focus" style cr x y width height))))
(define-method fix-ink-move! ((ink <box-ink>) dx dy)
(generic-fix-ink-move! ink dx dy))