+ (widget-show w))))
+
+(defun demo-all ()
+ (within-main-loop
+ (let* ((window (make-instance 'gtk-window
+ :title "cl-gtk2-gtk demo"
+ :window-position :center
+ :default-width 500
+ :default-height 500))
+ (scrolled (make-instance 'scrolled-window
+ :hscrollbar-policy :automatic
+ :vscrollbar-policy :automatic))
+ (viewport (make-instance 'viewport))
+ (v-box-buttons (make-instance 'v-box))
+ (v-box-top (make-instance 'v-box)))
+ (container-add window v-box-top)
+ (box-pack-start v-box-top (make-instance 'label :label "These are the demos of cl-gtk2-gtk:") :expand nil)
+ (box-pack-start v-box-top scrolled)
+ (container-add scrolled viewport)
+ (container-add viewport v-box-buttons)
+ (iter (for s in-package :gtk-demo :external-only t)
+ (for fn = (fdefinition s))
+ (unless fn (continue))
+ (when (eq s 'demo-all) (continue))
+ (for docstring = (documentation fn t))
+ (for description = (format nil "~A~@[~%~A~]" (string-downcase (symbol-name s)) docstring))
+ (for label = (make-instance 'label :label description :justify :center))
+ (for button = (make-instance 'button))
+ (container-add button label)
+ (connect-signal button "clicked"
+ (let ((fn fn))
+ (lambda (b)
+ (declare (ignore b))
+ (funcall fn))))
+ (box-pack-start v-box-buttons button :expand nil))
+ (widget-show window))))