(let ((window (make-instance 'gtk-window :type :toplevel :app-paintable t))
x y)
(g-signal-connect window "destroy" (lambda (widget)
+ (declare (ignore widget))
(leave-gtk-main)))
(g-signal-connect window "motion-notify-event" (lambda (widget event)
+ (declare (ignore widget))
(setf x (event-motion-x event)
y (event-motion-y event))
(widget-queue-draw window)))
(g-signal-connect window "expose-event"
(lambda (widget event)
- (declare (ignore event))
- ;(print event)
+ (declare (ignore widget event))
(let* ((gdk-window (widget-window window))
(gc (gdk-gc-new gdk-window))
(layout (widget-create-pango-layout window (format nil "X: ~F~%Y: ~F" x y))))
(gdk-draw-line gdk-window gc 0 0 x y)))))
(g-signal-connect window "configure-event"
(lambda (widget event)
- (declare (ignore event))
+ (declare (ignore widget event))
(widget-queue-draw window)))
(widget-show window)
(push :pointer-motion-mask (gdk-window-events (widget-window window))))))
(box-pack-start box w)
(container-add w text-view))
(container-add window box)
- (g-signal-connect window "destroy" (lambda (widget) (leave-gtk-main)))
+ (g-signal-connect window "destroy" (lambda (widget) (declare (ignore widget)) (leave-gtk-main)))
(g-signal-connect window "delete-event" (lambda (widget event)
- (declare (ignore event))
+ (declare (ignore widget event))
(let ((dlg (make-instance 'message-dialog
:text "Are you sure?"
:buttons :yes-no)))
(object-destroy dlg)
(not (eq :yes response))))))
(g-signal-connect button "clicked" (lambda (button)
- (setf (text-buffer-text text-buffer)
- (format nil "~A~%~A" (text-buffer-text text-buffer) (entry-text entry))
- (entry-text entry) "")))
+ (declare (ignore button))
+ (setf (text-buffer-text text-buffer)
+ (format nil "~A~%~A" (text-buffer-text text-buffer) (entry-text entry))
+ (entry-text entry) "")))
(g-signal-connect button-select "clicked" (lambda (button)
- (editable-select-region entry 5 10)))
+ (declare (ignore button))
+ (editable-select-region entry 5 10)))
(g-signal-connect button-insert "clicked" (lambda (button)
- (editable-insert-text entry "hello" 2)))
+ (declare (ignore button))
+ (editable-insert-text entry "hello" 2)))
(widget-show window))))
(defun table-packing ()
(table-attach table button-1 0 1 0 1)
(table-attach table button-2 1 2 0 1)
(table-attach table button-q 0 2 1 2)
- (g-signal-connect window "destroy" (lambda (w) (leave-gtk-main)))
- (g-signal-connect button-q "clicked" (lambda (b) (object-destroy window)))
+ (g-signal-connect window "destroy" (lambda (w) (declare (ignore w)) (leave-gtk-main)))
+ (g-signal-connect button-q "clicked" (lambda (b) (declare (ignore b)) (object-destroy window)))
(widget-show window))))
(defun test-pixbuf ()
(vbox-1 (make-instance 'v-box)))
(container-add window vbox)
(box-pack-start vbox (make-instance 'label :text "Placing bg image" :font "Times New Roman Italic 10" :color "#00f" :request-height 40))
- (g-signal-connect window "destroy" (lambda (w) (leave-gtk-main)))
+ (g-signal-connect window "destroy" (lambda (w) (declare (ignore w)) (leave-gtk-main)))
(box-pack-start vbox eventbox)
(container-add eventbox vbox-1)
(box-pack-start vbox-1 (make-instance 'label :text "This is the eventbox"))
(let* ((window (make-instance 'gtk-window :title "Test images"))
(image (make-instance 'image :icon-name "applications-development" :icon-size 6)))
(container-add window image)
- (g-signal-connect window "destroy" (lambda (w) (leave-gtk-main)))
+ (g-signal-connect window "destroy" (lambda (w) (declare (ignore w)) (leave-gtk-main)))
(widget-show window))))
(defun test-progress-bar ()
(button-pulse (make-instance 'button :label "Pulse"))
(button-set (make-instance 'button :label "Set"))
(entry (make-instance 'entry)))
- (g-signal-connect window "destroy" (lambda (w) (leave-gtk-main)))
+ (g-signal-connect window "destroy" (lambda (w) (declare (ignore w)) (leave-gtk-main)))
(container-add window v-box)
(box-pack-start v-box p-bar)
(box-pack-start v-box button-pulse)
(box-pack-start v-box button-set)
(box-pack-start v-box entry)
- (g-signal-connect button-pulse "clicked" (lambda (w) (progress-bar-pulse p-bar)))
+ (g-signal-connect button-pulse "clicked" (lambda (w) (declare (ignore w)) (progress-bar-pulse p-bar)))
(g-signal-connect button-set "clicked" (lambda (w)
- (setf (progress-bar-fraction p-bar)
- (coerce (read-from-string (entry-text entry)) 'real))))
+ (declare (ignore w))
+ (setf (progress-bar-fraction p-bar)
+ (coerce (read-from-string (entry-text entry)) 'real))))
(widget-show window))))
(defun test-status-bar ()
(icon (make-instance 'status-icon :icon-name "applications-development")))
(set-status-icon-tooltip icon "An icon from lisp program")
(g-signal-connect window "destroy" (lambda (w)
- #+ (or) (setf (status-icon-visible icon) nil)
- (leave-gtk-main)))
- (g-signal-connect button-push "clicked" (lambda (b) (status-bar-push status-bar "lisp-prog" (entry-text entry))))
- (g-signal-connect button-pop "clicked" (lambda (b) (status-bar-pop status-bar "lisp-prog")))
+ (declare (ignore w))
+ #+ (or) (setf (status-icon-visible icon) nil)
+ (leave-gtk-main)))
+ (g-signal-connect button-push "clicked" (lambda (b)
+ (declare (ignore b))
+ (status-bar-push status-bar "lisp-prog" (entry-text entry))))
+ (g-signal-connect button-pop "clicked" (lambda (b)
+ (declare (ignore b))
+ (status-bar-pop status-bar "lisp-prog")))
(g-signal-connect icon "activate" (lambda (i)
- (let ((message-dialog (make-instance 'message-dialog
- :buttons :ok
- :text "You clicked on icon!")))
- (dialog-run message-dialog)
- (object-destroy message-dialog))))
+ (declare (ignore i))
+ (let ((message-dialog (make-instance 'message-dialog
+ :buttons :ok
+ :text "You clicked on icon!")))
+ (dialog-run message-dialog)
+ (object-destroy message-dialog))))
(container-add window v-box)
(box-pack-start v-box h-box :expand nil)
(box-pack-start h-box entry)
(within-main-loop
(let* ((window (make-instance 'gtk-window :type :toplevel :title "Testing scale button"))
(button (make-instance 'scale-button :icons (list "media-seek-backward" "media-seek-forward" "media-playback-stop" "media-playback-start") :adjustment (make-instance 'adjustment :lower -40 :upper 50 :value 20))))
- (g-signal-connect window "destroy" (lambda (w) (leave-gtk-main)))
+ (g-signal-connect window "destroy" (lambda (w) (declare (ignore w)) (leave-gtk-main)))
(container-add window button)
(widget-show window))))
(v (make-instance 'text-view :buffer buffer :wrap-mode :word))
(box (make-instance 'v-box))
(scrolled (make-instance 'scrolled-window :hscrollbar-policy :automatic :vscrollbar-policy :automatic)))
- (g-signal-connect window "destroy" (lambda (w) (leave-gtk-main)))
+ (g-signal-connect window "destroy" (lambda (w) (declare (ignore w)) (leave-gtk-main)))
(g-signal-connect button "clicked" (lambda (b)
- (let* ((i1 (make-instance 'text-iter))
- (i2 (make-instance 'text-iter)))
- (multiple-value-bind (i1 i2) (text-buffer-get-selection-bounds buffer)
- (when (and i1 i2)
- (let* ((i1 i1) (i2 i2)
- (dialog (make-instance 'message-dialog :buttons :ok)))
- (setf (message-dialog-text dialog)
- (format nil "selection: from (~A,~A) to (~A,~A)"
- (text-iter-line i1) (text-iter-line-offset i1)
- (text-iter-line i2) (text-iter-line-offset i2)))
- (dialog-run dialog)
- (object-destroy dialog)))))))
+ (declare (ignore b))
+ (multiple-value-bind (i1 i2) (text-buffer-get-selection-bounds buffer)
+ (when (and i1 i2)
+ (let* ((i1 i1) (i2 i2)
+ (dialog (make-instance 'message-dialog :buttons :ok)))
+ (setf (message-dialog-text dialog)
+ (format nil "selection: from (~A,~A) to (~A,~A)"
+ (text-iter-line i1) (text-iter-line-offset i1)
+ (text-iter-line i2) (text-iter-line-offset i2)))
+ (dialog-run dialog)
+ (object-destroy dialog))))))
(g-signal-connect bold-btn "clicked" (Lambda (b)
+ (declare (ignore b))
(multiple-value-bind (start end) (text-buffer-get-selection-bounds buffer)
(when (and start end)
(let* ((start start)
(if (text-iter-has-tag start tag)
(text-buffer-remove-tag buffer tag start end)
(text-buffer-apply-tag buffer tag start end)))))))
- (g-signal-connect button-insert "clicked" (lambda (b) (declare (ignore b))
- (let* ((iter (text-buffer-get-iter-at-mark buffer (text-buffer-get-mark buffer "insert")))
- (anchor (text-buffer-insert-child-anchor buffer iter))
- (button (make-instance 'button :label "A button!")))
- (widget-show button)
- (text-view-add-child-at-anchor v button anchor))))
+ (g-signal-connect button-insert "clicked" (lambda (b)
+ (declare (ignore b))
+ (let* ((iter (text-buffer-get-iter-at-mark buffer (text-buffer-get-mark buffer "insert")))
+ (anchor (text-buffer-insert-child-anchor buffer iter))
+ (button (make-instance 'button :label "A button!")))
+ (widget-show button)
+ (text-view-add-child-at-anchor v button anchor))))
(let ((tag (make-instance 'text-tag :name "bold" :weight 700)))
(text-tag-table-add (text-buffer-tag-table buffer) tag)
(g-signal-connect tag "event"
(scrolled (make-instance 'scrolled-window :hscrollbar-policy :automatic :vscrollbar-policy :automatic))
(buffer (make-instance 'text-buffer))
(view (make-instance 'text-view :buffer buffer)))
- (g-signal-connect window "destroy" (lambda (w) (leave-gtk-main)))
+ (g-signal-connect window "destroy" (lambda (w) (declare (ignore w)) (leave-gtk-main)))
(container-add window scrolled)
(container-add scrolled view)
(widget-show window)
(store-add-item model (make-tvi :title "Saturday" :value 6))
(store-add-item model (make-tvi :title "Sunday" :value 7))
(setf (tree-view-model tv) model (tree-view-tooltip-column tv) 0)
- (gobject:g-signal-connect window "destroy" (lambda (w) (leave-gtk-main)))
- (gobject:g-signal-connect button "clicked" (lambda (b)
- (store-add-item model (make-tvi :title (entry-text title-entry)
- :value (or (parse-integer (entry-text value-entry)
- :junk-allowed t)
- 0)))))
+ (gobject:g-signal-connect window "destroy" (lambda (w) (declare (ignore w)) (leave-gtk-main)))
+ (gobject:g-signal-connect button "clicked" (lambda (b)
+ (declare (ignore b))
+ (store-add-item model (make-tvi :title (entry-text title-entry)
+ :value (or (parse-integer (entry-text value-entry)
+ :junk-allowed t)
+ 0)))))
(g-signal-connect tv "row-activated" (lambda (tv path column)
+ (declare (ignore tv column))
(format t "You clicked on row ~A~%" (tree-path-indices path))))
(container-add window v-box)
(box-pack-start v-box h-box :expand nil)
(store-add-item model (make-tvi :title "Friday" :value 5))
(store-add-item model (make-tvi :title "Saturday" :value 6))
(store-add-item model (make-tvi :title "Sunday" :value 7))
- (gobject:g-signal-connect window "destroy" (lambda (w) (leave-gtk-main)))
+ (gobject:g-signal-connect window "destroy" (lambda (w) (declare (ignore w)) (leave-gtk-main)))
(gobject:g-signal-connect button "clicked" (lambda (b)
- (store-add-item model (make-tvi :title (entry-text title-entry)
- :value (or (parse-integer (entry-text value-entry)
- :junk-allowed t)
- 0)))))
+ (declare (ignore b))
+ (store-add-item model (make-tvi :title (entry-text title-entry)
+ :value (or (parse-integer (entry-text value-entry)
+ :junk-allowed t)
+ 0)))))
(g-signal-connect combo-box "changed" (lambda (c)
(declare (ignore c))
(format t "You clicked on row ~A~%" (combo-box-active combo-box))))
<separator/>
</toolbar>
</ui>")
- (gobject:g-signal-connect window "destroy" (lambda (w) (leave-gtk-main)))
+ (gobject:g-signal-connect window "destroy" (lambda (w) (declare (ignore w)) (leave-gtk-main)))
(iter (with fn = (lambda (action) (when print-confirmation (format t "Action ~A with name ~A activated~%" action (action-name action)))))
(with action-group = (make-instance 'action-group :name "Actions"))
(finally (let ((a (make-instance 'toggle-action :name "print-confirm" :label "Print" :stock-id "gtk-print-report" :active t)))
(within-main-loop
(let ((window (make-instance 'gtk-window :title "Color button" :type :toplevel :window-position :center :width-request 100 :height-request 100))
(button (make-instance 'color-button :title "Color button")))
- (g-signal-connect window "destroy" (lambda (w) (leave-gtk-main)))
- (g-signal-connect button "color-set" (lambda (b) (format t "Chose color ~A~%" (color-button-color button))))
+ (g-signal-connect window "destroy" (lambda (w) (declare (ignore w)) (leave-gtk-main)))
+ (g-signal-connect button "color-set" (lambda (b)
+ (declare (ignore b))
+ (format t "Chose color ~A~%" (color-button-color button))))
(container-add window button)
(widget-show window))))
(setf (tree-view-model tree-view) model
(tree-view-tooltip-column tree-view) 0)
(connect-signal tree-view "row-activated" (lambda (tv path column)
+ (declare (ignore tv column))
(format t "You clicked on row ~A~%" (tree-path-indices path))))
(connect-signal button "clicked" (lambda (b)
(declare (ignore b))