(rect (fix-widget-geometry widget)))
(%trace "; allocated "width"x"height" to "widget"\n")
(set-fix-rect! rect x y width height)
- ;; For the random toolkit GtkWidget method too.
+ ;; For gtk-widget-get-size and random toolkit methods.
(C->= alien "GtkWidget allocation x" x)
(C->= alien "GtkWidget allocation y" y)
(C->= alien "GtkWidget allocation width" width)
(define-method initialize-instance ((widget <fix-resizer>) width height)
(call-next-method widget width height)
- (guarantee-fix-widget (fix-resizer-resizee widget)
- '(initialize-instance <fix-resizer>))
+ (%trace "; (initialize-instance <fix-resizer>) "widget" "width"x"height"\n")
(let ((vertical? (or (and (fix:< width 1) (fix:> height 0))
(fix:< height width)
(error "Ambiguous verticality:" widget width height))))
(let* ((geom (fix-widget-geometry resizer))
(x-parent (fix:+ x (fix-rect-x geom)))
(y-parent (fix:+ y (fix-rect-y geom)))
- (geomee (fix-widget-geometry (fix-resizer-resizee resizer)))
- (width (fix-rect-width geomee))
- (height (fix-rect-height geomee)))
+ (width.height (gtk-widget-get-size resizee)))
(%trace "; drag start"
- " at "x-parent","y-parent" with "width"x"height"!\n")
+ " at "x-parent","y-parent
+ " with "(car width.height)"x"(cdr width.height)"!\n")
(set-fix-resizer-drag-start! resizer (cons (cons x-parent y-parent)
- (cons width height)))
+ width.height))
(C-call "gtk_grab_add" (gobject-alien resizer)))))
(define (resizer-release-handler resizer type button modifiers x y)
(fix:max (fix:+ height-start (fix:- y-parent y-start))
2)
height-start))
- (resizee (fix-resizer-resizee resizer))
- (geomee (fix-widget-geometry resizee))
- (width (fix-rect-width geomee))
- (height (fix-rect-height geomee)))
- (if (not (and (fix:= width width-new)
- (fix:= height height-new)))
- (begin
- (%trace "; resizing to "width-new"x"height-new"\n")
- (set-fix-widget-size! resizee width-new height-new))
- (begin
- (%trace "; fine with "width"x"height"\n"))))
+ (resizee (fix-resizer-resizee resizer)))
+ (%trace "; resizing to "width-new"x"height-new"\n")
+ (gtk-widget-set-size-request resizee width-new height-new))
(begin
(%trace "; drag dropped!\n")
(C-call "gtk_grab_remove" (gobject-alien resizer))