updates to use specifc element types

This commit is contained in:
David Botton 2021-01-29 01:16:05 -05:00
parent 264cef0db2
commit 04b2fd316f
7 changed files with 27 additions and 15 deletions

View file

@ -4,18 +4,19 @@
(in-package :clog-user)
(defun my-on-click (obj) ; obj in any event is the target of the event
(setf (color obj) "green")) ; this makes it possible to reuse events
(defun my-on-click (obj) ; obj in any event is the target of the event
(setf (color obj) (rgb 0 255 0))) ; this makes it possible to reuse events
; RGB is a helper function for colors
(defun on-new-window (body)
"On-new-window handler."
(setf (title (html-document body)) "Tutorial 4")
(set-on-click (create-child body "<h1>Hello World! (click me!)</h1>")
(set-on-click (create-section body :h1 :content "Hello World! (click me!)")
#'my-on-click)
(set-on-click (create-child body "<h3>Click me too!</h3>")
(set-on-click (create-section body :h3 :content "Click me too!")
#'my-on-click)
(run body))