mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-07 11:10:18 -08:00
singleton demo
This commit is contained in:
parent
f2ae15534c
commit
58d30a60bc
4 changed files with 35 additions and 5 deletions
22
demos/02-singleton.lisp
Normal file
22
demos/02-singleton.lisp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(defpackage #:clog-user
|
||||
(:use #:cl #:clog)
|
||||
(:export start-demo))
|
||||
|
||||
(in-package :clog-user)
|
||||
|
||||
(defun start-demo ()
|
||||
"How to allow only one CLOG app to be executed. Normally many browsers can
|
||||
can be started with the same app."
|
||||
|
||||
(clog:initialize
|
||||
(lambda (win)
|
||||
(let ((click-target (clog:create-child win "<h1>Hello World!</H1>")))
|
||||
(clog:set-on-click click-target
|
||||
(lambda ()
|
||||
(clog:create-child win "<p>You Clicked me!</p>")))
|
||||
(clog:set-on-new-window
|
||||
(lambda (win)
|
||||
(clog:put-br (clog:html-document win)
|
||||
"Only single connection premitted."))))))
|
||||
|
||||
(clog:open-browser))
|
||||
Loading…
Add table
Add a link
Reference in a new issue