(gtk-container-add scroller1 layout1)
(gtk-container-add vgrid scroller1)
- (set-fix-resizer-before! resizer scroller1)
- (set-fix-resizer-after! resizer scroller2)
+ (set-fix-resizer-before! resizer layout1)
+ (set-fix-resizer-after! resizer layout2)
(gtk-container-add vgrid resizer)
(gtk-container-add scroller2 layout2)
(gtk-container-add vgrid scroller2)
;; Inferred from aspect ratio.
(stack-vertical? define standard)
- ;; The widget that is above or left of this widget.
- (before define standard initial-value #f)
+ ;; The scm-widget that is above or left of this widget.
+ (%before define standard initial-value #f)
- ;; The widget that is below or right of this widget.
- (after define standard initial-value #f)
+ ;; The scm-widget that is below or right of this widget.
+ (%after define standard initial-value #f)
;; #t while a gtk_grab_add is in effect.
(dragging? define standard initial-value #f))
(error "Ambiguous verticality:" w h widget))))))
(set-fix-resizer-stack-vertical?! widget vertical?)))
+(define fix-resizer-before fix-resizer-%before)
+
+(define (set-fix-resizer-before! resizer before)
+ (guarantee-scm-widget before 'set-fix-resizer-before!)
+ (set-fix-resizer-%before! resizer before))
+
+(define fix-resizer-after fix-resizer-%after)
+
+(define (set-fix-resizer-after! resizer after)
+ (guarantee-scm-widget after 'set-fix-resizer-after!)
+ (set-fix-resizer-%after! resizer after))
+
(define-method fix-widget-realize-callback ((widget <fix-resizer>))
(call-next-method widget)
(%trace "; (fix-widget-realize-callback <fix-resizer>) "widget"\n")
(let ((w (fix:+ (car w.h-before) dx))
(h (fix:+ (cdr w.h-before) dy)))
(%trace "; resizing "before" to "w"x"h"\n")
- (set-scm-widget-natural-size! (gtk-bin-child before)
- w h))
+ (set-scm-widget-natural-size! before w h))
(let ((w (fix:- (car w.h-after) dx))
(h (fix:- (cdr w.h-after) dy)))
(%trace "; resizing "after" to "w"x"h"\n")
- (set-scm-widget-natural-size! (gtk-bin-child after)
- w h))
- (C-call "gtk_container_resize_children"
- (gobject-alien
- (gtk-widget-parent resizer)))))))
+ (set-scm-widget-natural-size! after w h))
+ (C-call "gtk_widget_queue_resize_no_redraw"
+ (gobject-alien before))
+ (C-call "gtk_widget_queue_resize_no_redraw"
+ (gobject-alien after))))))
(if (fix-resizer-stack-vertical? resizer)
gtk-container-children gtk-bin-child
gtk-container-add gtk-container-remove
gtk-container-set-border-width
- ;;gtk-container-set-resize-mode
- ;;gtk-container-check-resize
<gtk-window> gtk-window? guarantee-gtk-window
gtk-window-new gtk-window-type
(import (gtk gtk-widget)
set-gtk-widget-destroy-callback!)
(export (gtk)
- <scm-widget>
+ <scm-widget> guarantee-scm-widget
set-scm-widget-set-scroll-adjustments-callback!
set-scm-widget-minimum-size! set-scm-widget-natural-size!))
{
gchar * fdstr, * text;
- text = g_strdup_printf ("Scheme time-slice: %d\n", slice_counter);
+ text = g_strdup_printf ("Scheme time-slice: %d", slice_counter);
gtk_label_set_text (GTK_LABEL (slice_label), text);
g_free (text);
gtk_window_set_type_hint (GTK_WINDOW (slice_window),
GDK_WINDOW_TYPE_HINT_UTILITY);
gtk_widget_show_all (slice_window);
-
- /* If G_PRIORITY_LOW is too low, and the deprecated
- GTK_RESIZE_IMMEDIATE is still available, this also worked:
-
- gtk_container_set_resize_mode (GTK_CONTAINER (slice_window),
- GTK_RESIZE_IMMEDIATE); */
-
- gtk_window_parse_geometry (GTK_WINDOW (slice_window), "250x50+0-40");
+ gtk_window_parse_geometry (GTK_WINDOW (slice_window), "-0-0");
}
static void