chiark / gitweb /
Added missing DESTROY-FUNCTION method for TREE-PATH
[clg] / examples / testgtk.lisp
index c587b266b02a98b96fd9f3735be511d7cb794b7f..e5b7961bac2d295f16be7d4b67283011a697e39d 100644 (file)
@@ -15,7 +15,7 @@
 ;; License along with this library; if not, write to the Free Software
 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-;; $Id: testgtk.lisp,v 1.20 2005-02-27 12:44:07 espen Exp $
+;; $Id: testgtk.lisp,v 1.23 2005-02-27 19:15:07 espen Exp $
 
 
 ;(use-package "GTK")
@@ -452,6 +452,12 @@ (define-simple-dialog create-expander (dialog "Expander" :resizable nil)
 ;; File chooser dialog
 
 (define-dialog create-file-chooser (dialog "File Chooser" 'file-chooser-dialog)
+  (file-chooser-add-filter dialog 
+   (make-instance 'file-filter :name "All files" :pattern "*"))
+  (file-chooser-add-filter dialog 
+   (make-instance 'file-filter :name "Common Lisp source code" 
+    :patterns '("*.lisp" "*.lsp")))
+
   (dialog-add-button dialog "gtk-cancel" #'widget-destroy :object t)
   (dialog-add-button dialog "gtk-ok" 
    #'(lambda ()
@@ -461,6 +467,15 @@ (define-dialog create-file-chooser (dialog "File Chooser" 'file-chooser-dialog)
        (widget-destroy dialog))))
 
 
+;; Font selection dialog
+
+(define-toplevel create-font-selection (window "Font Button" :resizable nil)
+  (make-instance 'h-box 
+   :parent window :spacing 8 :border-width 8
+   :child (make-instance 'label :label "Pick a font")
+   :child (make-instance 'font-button 
+           :use-font t :title "Font Selection Dialog")))
+
 
 ;;; Handle box
 
@@ -1702,7 +1717,7 @@ (defun create-main-window ()
 ;;         ("event watcher")
            ("enxpander" create-expander)
            ("file chooser" create-file-chooser)
-;;         ("font selection")
+           ("font selection" create-font-selection)
            ("handle box" create-handle-box)
            ("image" create-image)
            ("labels" create-labels)
@@ -1760,6 +1775,13 @@ (defun create-main-window ()
      :child-args '(:expand nil)
      :child (list (make-instance 'label :label (gtk-version)) :fill nil)
      :child (list (make-instance 'label :label "clg CVS version") :fill nil)
+     :child (list (make-instance 'label                          
+                  :label #-cmu(format nil "~A (~A)" 
+                               (lisp-implementation-type)
+                               (lisp-implementation-version))
+                         ;; The version string in CMUCL is far too long
+                         #+cmu(lisp-implementation-type))
+                 :fill nil)
      :child (list scrolled-window :expand t)
      :child (make-instance 'h-separator)
      :child (make-instance 'v-box