mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 10:40:45 -08:00
updates to use specifc element types
This commit is contained in:
parent
264cef0db2
commit
04b2fd316f
7 changed files with 27 additions and 15 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue