From 0edcaacf88b8d7e8aff137bfad965117bdf8561a Mon Sep 17 00:00:00 2001 From: frese Date: Tue, 2 Apr 2002 11:39:10 +0000 Subject: [PATCH] + added window-exists? predicate. --- scheme/xlib/window.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scheme/xlib/window.scm b/scheme/xlib/window.scm index bb9bac0..76c2668 100644 --- a/scheme/xlib/window.scm +++ b/scheme/xlib/window.scm @@ -49,6 +49,16 @@ 'copy-from-parent 'copy-from-parent 'copy-from-parent set-window-attribute-alist)) +;; window-exists? returns #t if the windows still exists (makes sense, +;; doesn't it :-) + +(define (window-exists? window) + (and (integer? (window-Xwindow window)) ;; hasn't been destroyed by + ;; destroy-window + (if (query-tree window) ;; query-tree returns #f if + #t #f))) ;; the window does not + ;; exists. + ;; *** change-window-attributes ************************************** ;; change-window-attributes takes an alist of set-window-attributes @@ -317,11 +327,6 @@ (let ((t (query-tree window))) (and t (caddr t)))) -(define (window-exists? window) ;; maybe this should be done a little - ;; bit more clever - (if (query-tree window) - #t #f)) - ;; translate-coordinates takes the x and y coordinates relative to the ;; source window's origin and returns a list of three elements: the x ;; and y coordinates relative to the destination window's origin. If