mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 10:40:45 -08:00
A clog-body is passed to on-new-window
This commit is contained in:
parent
5efce9a065
commit
d2fdc58a40
2 changed files with 12 additions and 8 deletions
|
|
@ -36,17 +36,19 @@ Sample CLOG app with code base so far:
|
|||
|
||||
|
||||
;; Define our CLOG application
|
||||
(defun on-new-window (window) ; Define the function called on-new-window
|
||||
(defun on-new-window (body) ; Define the function called on-new-window
|
||||
"On-new-window handler." ; Optional docstring to describe function
|
||||
|
||||
(let ((hello-element ; hello-element is a local variable that
|
||||
; will be bound to our new CLOG-Element
|
||||
|
||||
;; This application simply creates a CLOG-Element as a child to window.
|
||||
;; This application simply creates a CLOG-Element as a child to the
|
||||
;; CLOG-body object in the browser window.
|
||||
|
||||
;; A CLOG-Element represents a block of HTML (we will see later ways to
|
||||
;; directly create buttons and all sorts of HTML elements in more lisp
|
||||
;; like ways with no knowledge of HTML or javascript.
|
||||
(create-child window "<h1>Hello World! (click me!)</h1>")))
|
||||
(create-child body "<h1>Hello World! (click me!)</h1>")))
|
||||
|
||||
(set-on-click hello-element ; Now we set a function to handle clicks
|
||||
(lambda () ; In this case we use an anonymous function
|
||||
|
|
|
|||
|
|
@ -6,17 +6,19 @@
|
|||
|
||||
|
||||
;; Define our CLOG application
|
||||
(defun on-new-window (window) ; Define the function called on-new-window
|
||||
(defun on-new-window (body) ; Define the function called on-new-window
|
||||
"On-new-window handler." ; Optional docstring to describe function
|
||||
|
||||
(let ((hello-element ; hello-element is a local variable that
|
||||
; will be bound to our new CLOG-Element
|
||||
|
||||
;; This application simply creates a CLOG-Element as a child to window.
|
||||
;; This application simply creates a CLOG-Element as a child to the
|
||||
;; CLOG-body object in the browser window.
|
||||
|
||||
;; A CLOG-Element represents a block of HTML (we will see later ways to
|
||||
;; directly create buttons and all sorts of HTML elements in more lisp
|
||||
;; like ways with no knowledge of HTML or javascript.
|
||||
(create-child window "<h1>Hello World! (click me!)</h1>")))
|
||||
(create-child body "<h1>Hello World! (click me!)</h1>")))
|
||||
|
||||
(set-on-click hello-element ; Now we set a function to handle clicks
|
||||
(lambda () ; In this case we use an anonymous function
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue