(defpackage #:clog-user (:use #:cl #:clog #:clog-gui) ; For this tutorial we include clog-gui (:export start-tutorial)) (in-package :clog-user) ;; For web oriented apps consider using the :client-movement option. ;; See clog-gui-initialize documentation. (defun on-file-count (obj) (let ((win (create-gui-window obj :title "Count"))) (dotimes (n 100) ;; window-content is the root element for the clog-gui ;; windows (create-div (window-content win) :content n)))) (defun on-file-browse (obj) (let* ((win (create-gui-window obj :title "Browse"))) (create-child (window-content win) ""))) (defun on-file-drawing (obj) (let* ((win (create-gui-window obj :title "Drawing")) (canvas (create-canvas (window-content win) :width 600 :height 400)) (cx (create-context2d canvas))) (set-border canvas :thin :solid :black) (fill-style cx :green) (fill-rect cx 10 10 150 100) (fill-style cx :blue) (font-style cx "bold 24px serif") (fill-text cx "Hello World" 10 150) (fill-style cx :red) (begin-path cx) (ellipse cx 200 200 50 7 0.78 0 6.29) (path-stroke cx) (path-fill cx))) (defun on-file-movies (obj) (let* ((win (create-gui-window obj :title "Movie")) (movie (create-video (window-content win) :source "https://www.w3schools.com/html/mov_bbb.mp4"))) (setf (box-width movie) "100%") (setf (box-height movie) "100%"))) (defun on-file-pinned (obj) (let ((win (create-gui-window obj :title "Pin me!" :has-pinner t :keep-on-top t :top 200 :left 0 :width 200 :height 200))) (create-div win :content "I can be pinned. Just click the pin on window bar."))) (defun on-dlg-alert (obj) (alert-dialog obj "This is a modal alert box")) (defun on-dlg-confirm (obj) (confirm-dialog obj "Shall we play a game?" (lambda (input) (if input (alert-dialog obj "How about Global Thermonuclear War.") (alert-dialog obj "You are no fun!"))) :ok-text "Yes" :cancel-text "No")) (defun on-dlg-input (obj) (input-dialog obj "Would you like to play a game?" (lambda (input) (alert-dialog obj input)))) (defun on-dlg-file (obj) (server-file-dialog obj "Server files" "./" (lambda (fname) (alert-dialog obj fname)))) (defun on-dlg-form (obj) (form-dialog obj "Please enter your information." '(("Title" "title" (("Mr." "mr") ("Mrs." "mrs") ("Ms." "ms") ("Other" "other"))) ("Name" "name") ("Address" "address") ("City" "city") ("State" "st") ("Zip" "zip")) (lambda (results) (alert-dialog obj results)) :height 550)) (defun on-help-about (obj) (let* ((about (create-gui-window obj :title "About" :content "