From c82e171568e854170917b2b6e8840c7a85c470f3 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Fri, 16 Sep 2011 12:18:07 -0700 Subject: [PATCH] Propagate destroy through . Use it with s. --- src/gtk/fix-layout.scm | 5 +++++ src/gtk/gtk-object.scm | 4 ++++ src/gtk/gtk.pkg | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gtk/fix-layout.scm b/src/gtk/fix-layout.scm index fe51b033b..31c7f46a4 100644 --- a/src/gtk/fix-layout.scm +++ b/src/gtk/fix-layout.scm @@ -65,6 +65,11 @@ USA. (define-guarantee fix-layout "a ") +(define-method gtk-object-destroy-callback ((layout )) + (call-next-method layout) + (let ((drawing (fix-layout-drawing layout))) + (if drawing (fix-drawing-remove-widget! drawing layout)))) + (define-integrable (allocate-color! layout spec) (let* ((colors (fix-layout-colors layout)) (entry (assoc spec colors))) diff --git a/src/gtk/gtk-object.scm b/src/gtk/gtk-object.scm index e9ae02d38..f8969b569 100644 --- a/src/gtk/gtk-object.scm +++ b/src/gtk/gtk-object.scm @@ -452,6 +452,10 @@ USA. ;; they were added. (reverse-children define standard initial-value '())) +(define-method gtk-object-destroy-callback ((container )) + (call-next-method container) + (for-each gtk-object-destroy (gtk-container-reverse-children container))) + (define-guarantee gtk-container "a ") (define (gtk-container-children container) diff --git a/src/gtk/gtk.pkg b/src/gtk/gtk.pkg index 94d470498..c1041f6cd 100644 --- a/src/gtk/gtk.pkg +++ b/src/gtk/gtk.pkg @@ -213,7 +213,9 @@ USA. (import (gtk pango) make-pango-layout pango-rectangle pangos->pixels pixels->pangos) (import (gtk gtk-object) - parse-gdkcolor set-gtk-object-destroy-callback!) + parse-gdkcolor + set-gtk-object-destroy-callback! + gtk-object-destroy-callback) (export (gtk) fix-layout? make-fix-layout set-fix-layout-size! -- 2.25.1