mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
pm-01 mavis risetti
This commit is contained in:
parent
bcbd88b3c7
commit
a171cb9162
2 changed files with 41 additions and 0 deletions
|
|
@ -2,3 +2,4 @@ Various source files indexed by their discussion or tickets on github
|
|||
I created in supporting questions.
|
||||
|
||||
* disc-38.lisp - use of the rgb function to compare colors
|
||||
* pm-01.list - create-child and :clog-type
|
||||
|
|
|
|||
40
support/pm-01.lisp
Normal file
40
support/pm-01.lisp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
;; mavis risetti PM on discord
|
||||
|
||||
(defpackage #:web
|
||||
(:use #:cl #:clog #:clog-gui)
|
||||
(:export start-web-app))
|
||||
|
||||
(in-package :web)
|
||||
|
||||
(defun on-new-window (body)
|
||||
(clog-gui-initialize body)
|
||||
(let ((ta (create-child body "<textarea>1</textarea>"))
|
||||
(gv (create-button body :content "Show me the value")))
|
||||
|
||||
;; This code will fail. The reason is that create-child by default
|
||||
;; creates on object of type clog-element and value does not exist
|
||||
;; clog-element
|
||||
(set-on-click gv (lambda (obj)
|
||||
(alert-dialog body :content (value ta)))))
|
||||
|
||||
(let ((ta (create-child body "<textarea>2</textarea>"
|
||||
:clog-type 'clog:clog-form-element))
|
||||
(gv (create-button body :content "Show me the value")))
|
||||
|
||||
;; This code will work.
|
||||
(set-on-click gv (lambda (obj)
|
||||
(alert-dialog body (value ta)))))
|
||||
|
||||
(let ((ta (create-text-area body)) ;; Returns a clog-text-area
|
||||
(gv (create-button body :content "Show me the value")))
|
||||
|
||||
;; This code is the idea using a clog-text-area returned
|
||||
(set-on-click gv (lambda (obj)
|
||||
(alert-dialog body (value ta)))))
|
||||
|
||||
(run body))
|
||||
|
||||
(defun start-web-app ()
|
||||
"Start the App!"
|
||||
(initialize #'on-new-window)
|
||||
(open-browser))
|
||||
Loading…
Add table
Add a link
Reference in a new issue