X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/clg/blobdiff_plain/ba22f655f5cd244dca4abdf4f93bd2dbb49483ae..d71326a2a619ac213d90dcc522a1354e37ce8e30:/examples/testgtk.lisp diff --git a/examples/testgtk.lisp b/examples/testgtk.lisp index 352d723..858d894 100644 --- a/examples/testgtk.lisp +++ b/examples/testgtk.lisp @@ -26,7 +26,7 @@ ;; Kimball, Josh MacDonald and others. -;; $Id: testgtk.lisp,v 1.38 2007-01-11 10:05:59 espen Exp $ +;; $Id: testgtk.lisp,v 1.41 2007-07-12 09:18:30 espen Exp $ #+sbcl(require :gtk) #+(or cmu clisp)(asdf:oos 'asdf:load-op :gtk) @@ -537,14 +537,14 @@ (defun load-pixbufs () (unless file-pixbuf (handler-case (setf - file-pixbuf (gdk:pixbuf-load #p"/usr/share/icons/gnome/48x48/filesystems/gnome-fs-regular.png") - folder-pixbuf (gdk:pixbuf-load #p"/usr/share/icons/gnome/48x48/filesystems/gnome-fs-directory.png")) + file-pixbuf (gdk:pixbuf-load #p"clg:examples;gnome-fs-regular.png") + folder-pixbuf (gdk:pixbuf-load #p"clg:examples;gnome-fs-directory.png")) (glib:glib-error (condition) (make-instance 'message-dialog :message-type :error :visible t :text "Failed to load an image" :secondary-text (glib:gerror-message condition) - :signal (list :close #'widget-destroy :object t)) + :signal (list :ok #'widget-destroy :object t)) (return-from load-pixbufs nil)))) t) @@ -1909,7 +1909,7 @@ (define-toplevel create-ui-manager (window "UI Manager") ;;; Main window -(defun create-main-window () +(defun create-main-window (&optional display) (let* ((button-specs '(("button box" create-button-box) ("buttons" create-buttons) @@ -1954,6 +1954,7 @@ (defun create-main-window () ("UI manager" create-ui-manager))) (main-window (make-instance 'window + :display display :title "testgtk.lisp" :name "main_window" :default-width 200 :default-height 400 :allow-grow t :allow-shrink nil)) @@ -1963,7 +1964,7 @@ (defun create-main-window () :border-width 10)) (close-button (make-instance 'button :stock "gtk-close" :can-default t - :signal (list 'clicked #'widget-destroy :object main-window)))) + :signal (list 'clicked #'widget-destroy :object main-window)))) (let ((icon (gdk:pixbuf-load #p"clg:examples;gtk.png"))) (setf @@ -2007,5 +2008,4 @@ (defun create-main-window () main-window)) (clg-init) -(create-main-window) - +(within-main-loop (create-main-window))