X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/0beedfe6f458b85521879ff012cb74501d963bcd..c0bc39e53c16a7e408b7bb0ecb13dc605f0b8ea4:/examples/testdnd.lisp diff --git a/examples/testdnd.lisp b/examples/testdnd.lisp index d796fd7..ff6702c 100644 --- a/examples/testdnd.lisp +++ b/examples/testdnd.lisp @@ -1,7 +1,7 @@ ;;;; Translation of dragndrop.py from the PyGTK 2.0 Tutorial #+sbcl(require :gtk) -#+cmu(asdf:oos 'asdf:load-op :gtk) +#+(or cmu clisp)(asdf:oos 'asdf:load-op :gtk) (defpackage "TESTDND" (:use "COMMON-LISP" "GTK") @@ -70,8 +70,6 @@ (defvar to-button (defvar to-canvas (make-instance 'target-entry :target "image/png" :id *target-type-image*)) - - (defun add-image (layout pixbuf xd yd) (let ((button (make-instance 'button :child (make-instance 'image :pixbuf pixbuf)))) @@ -84,12 +82,14 @@ (defun add-image (layout pixbuf xd yd) ((= target-type *target-type-text*) (selection-data-set-text selection #+cmu(ext:format-universal-time nil (get-universal-time) :style :rfc1123 :print-timezone nil) - #+sbcl(sb-int:format-universal-time nil (get-universal-time) :style :abbreviated :print-timezone nil))) + #+sbcl(sb-int:format-universal-time nil (get-universal-time) :style :abbreviated :print-timezone nil) + #+clisp(os:string-time "%x %X") + #-(or cmu sbcl clisp)(format nil "~D" (get-universal-time)))) ((= target-type *target-type-image*) (selection-data-set-pixbuf selection pixbuf))))) (drag-source-set button :button1 from-image :copy) - + (with-slots (hadjustment vadjustment) layout (layout-put layout button (truncate (+ xd (adjustment-value hadjustment))) @@ -144,4 +144,4 @@ (defun create-test () :child (create-layout 600 600))) (clg-init) -(create-test) +(within-main-loop (create-test))