diff --git a/tools/clog-builder-repl.lisp b/tools/clog-builder-repl.lisp index ad02a45..ab785e2 100644 --- a/tools/clog-builder-repl.lisp +++ b/tools/clog-builder-repl.lisp @@ -1,18 +1,35 @@ (in-package "CLOG-TOOLS") (defclass clog-builder-repl (clog:clog-panel) - ( (package-div :reader package-div) - (terminal :reader terminal) -)) -(defun create-clog-builder-repl (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) - (let ((panel (change-class (clog:create-div clog-obj :content "
" - :hidden hidden :class class :html-id html-id :auto-place auto-place) 'clog-builder-repl))) - (setf (slot-value panel 'package-div) (attach-as-child clog-obj "CLOGB3867357554" :clog-type 'CLOG:CLOG-FORM-ELEMENT :new-id t)) - (setf (slot-value panel 'terminal) (attach-as-child clog-obj "CLOGB3867357553" :clog-type 'CLOG-TERMINAL:CLOG-TERMINAL-ELEMENT :new-id t)) - (let ((target (terminal panel))) (declare (ignorable target)) (clog-terminal:attach-clog-terminal target :greetings "CLOG Builder REPL") (clog-terminal:prompt target "> ")) - (clog-terminal:set-on-command (terminal panel) (lambda (target data) (declare (ignorable target data)) (multiple-value-bind (result new-package) - (capture-eval data :clog-obj panel - :eval-in-package (text-value (package-div panel))) - (setf (text-value (package-div panel)) - (string-downcase (package-name new-package))) - (clog-terminal:echo target result)))) + ((package-div :reader package-div) (terminal :reader terminal))) +(defun create-clog-builder-repl + (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) + (let ((panel + (change-class + (clog:create-div clog-obj :content + "
" + :hidden hidden :class class :html-id html-id + :auto-place auto-place) + 'clog-builder-repl))) + (setf (slot-value panel 'package-div) + (attach-as-child clog-obj "CLOGB3868051527" :clog-type + 'clog:clog-form-element :new-id t)) + (setf (slot-value panel 'terminal) + (attach-as-child clog-obj "CLOGB3868051526" :clog-type + 'clog-terminal:clog-terminal-element :new-id t)) + (let ((target (terminal panel))) + (declare (ignorable target)) + (clog-terminal:attach-clog-terminal target :greetings + "CLOG Builder REPL") + (clog-terminal:prompt target "> ")) + (clog-terminal:set-on-command (terminal panel) + (lambda (target data) + (declare (ignorable target data)) + (multiple-value-bind (result new-package) + (capture-eval data :clog-obj panel + :eval-in-package + (text-value (package-div panel))) + (setf (text-value (package-div panel)) + (string-downcase + (package-name new-package))) + (clog-terminal:echo target result)))) panel)) diff --git a/tools/clog-builder.lisp b/tools/clog-builder.lisp index 67e1906..69ed8db 100644 --- a/tools/clog-builder.lisp +++ b/tools/clog-builder.lisp @@ -797,7 +797,18 @@ not a temporary attached one when using select-control." (declare (ignore html-id)) (place-after control (get-placer control))) (get-control-list app panel-id)) - result))) + ;; prety print the code + (let ((r (make-array '(0) :element-type 'base-char + :fill-pointer 0 :adjustable t))) + (with-output-to-string (s r) + (with-input-from-string (n result) + (let ((*standard-output* s) + (*print-case* :downcase)) + (loop + (let ((l (read n nil))) + (unless l (return)) + (pprint l)))))) + r)))) ;; Population of utility windows diff --git a/tools/clog-templates.lisp b/tools/clog-templates.lisp index df6e899..5cf013c 100644 --- a/tools/clog-templates.lisp +++ b/tools/clog-templates.lisp @@ -1,12 +1,24 @@ (in-package "CLOG-TOOLS") (defclass clog-templates (clog:clog-panel) - ( (fill-button :reader fill-button) - (template-box :reader template-box) -(win :accessor win))) -(defun create-clog-templates (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) - (let ((panel (change-class (clog:create-div clog-obj :content "
" - :hidden hidden :class class :html-id html-id :auto-place auto-place) 'clog-templates))) - (setf (slot-value panel 'fill-button) (attach-as-child clog-obj "CLOGB3854134564" :clog-type 'CLOG:CLOG-BUTTON :new-id t)) - (setf (slot-value panel 'template-box) (attach-as-child clog-obj "CLOGB3854134563" :clog-type 'CLOG:CLOG-SELECT :new-id t)) - (set-on-click (fill-button panel) (lambda (target) (declare (ignorable target)) (fill-button-clicked panel))) + ((fill-button :reader fill-button) + (template-box :reader template-box) (win :accessor win))) +(defun create-clog-templates + (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) + (let ((panel + (change-class + (clog:create-div clog-obj :content + "
" + :hidden hidden :class class :html-id html-id + :auto-place auto-place) + 'clog-templates))) + (setf (slot-value panel 'fill-button) + (attach-as-child clog-obj "CLOGB3868051557" :clog-type + 'clog:clog-button :new-id t)) + (setf (slot-value panel 'template-box) + (attach-as-child clog-obj "CLOGB3868051556" :clog-type + 'clog:clog-select :new-id t)) + (clog:set-on-click (fill-button panel) + (lambda (target) + (declare (ignorable target)) + (fill-button-clicked panel))) panel)) diff --git a/tools/image-to-data.lisp b/tools/image-to-data.lisp index c325cb5..d41613c 100644 --- a/tools/image-to-data.lisp +++ b/tools/image-to-data.lisp @@ -1,14 +1,27 @@ (in-package "CLOG-TOOLS") (defclass image-to-data (clog:clog-panel) - ( (submit-8 :reader submit-8) - (file-2 :reader file-2) - (form-7 :reader form-7) -)) -(defun create-image-to-data (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) - (let ((panel (change-class (clog:create-div clog-obj :content "
" - :hidden hidden :class class :html-id html-id :auto-place auto-place) 'image-to-data))) - (setf (slot-value panel 'submit-8) (attach-as-child clog-obj "CLOGB3865596275" :clog-type 'CLOG:CLOG-FORM-ELEMENT :new-id t)) - (setf (slot-value panel 'file-2) (attach-as-child clog-obj "CLOGB3865596274" :clog-type 'CLOG:CLOG-FORM-ELEMENT :new-id t)) - (setf (slot-value panel 'form-7) (attach-as-child clog-obj "CLOGB3865596273" :clog-type 'CLOG:CLOG-FORM :new-id t)) - (clog:set-on-click (submit-8 panel) (lambda (target) (declare (ignorable target)) (submit (form-7 panel)))) + ((submit-8 :reader submit-8) (file-2 :reader file-2) + (form-7 :reader form-7))) +(defun create-image-to-data + (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) + (let ((panel + (change-class + (clog:create-div clog-obj :content + "
" + :hidden hidden :class class :html-id html-id + :auto-place auto-place) + 'image-to-data))) + (setf (slot-value panel 'submit-8) + (attach-as-child clog-obj "CLOGB3868051675" :clog-type + 'clog:clog-form-element :new-id t)) + (setf (slot-value panel 'file-2) + (attach-as-child clog-obj "CLOGB3868051674" :clog-type + 'clog:clog-form-element :new-id t)) + (setf (slot-value panel 'form-7) + (attach-as-child clog-obj "CLOGB3868051673" :clog-type + 'clog:clog-form :new-id t)) + (clog:set-on-click (submit-8 panel) + (lambda (target) + (declare (ignorable target)) + (submit (form-7 panel)))) panel)) diff --git a/tools/quick-start.lisp b/tools/quick-start.lisp index d0b2dda..fc9b31a 100644 --- a/tools/quick-start.lisp +++ b/tools/quick-start.lisp @@ -1,34 +1,44 @@ (in-package "CLOG-TOOLS") (defclass quick-start (clog:clog-panel) - ( (Instructions :reader Instructions) - (span-13 :reader span-13) - (image-12 :reader image-12) -)) -(defun create-quick-start (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) - (let ((panel (change-class (clog:create-div clog-obj :content "\"Add CLOG The Common Lisp Omnificent GUI
-

Quick Start

-

Placing Controls

-Placing Controls - Click a control from the control pallets in the top left panel. Click on your panel
-Static Placement - Click a control from the control pallets in the top left panel. Click on your panel while holding down <ctrl/cmd>
-Place as child control - Click the parent control in your panel. Click a control from the control pallets in the top left panel. Click on your panel while holding down <shift>
-Place as static and child control - Click the parent control in your panel. Click a control from the control pallets in the top left panel. Click on your panel while holding down <shift>+<ctrl/cmd>
-
-

Existing Controls as Children

-2 ways:
-1. Click the parent control in your panel. Holding <shift> click the control to make a child.
-2. Use the control list in the lower left to drag and drop holding the <shift> key
-
-

Existing Controls as Static

-Use the positioning property in the property panel
-
-

Access Children Controls

-Double click the parent control, it will freeze (unfreeze by double clicking it in the control list in the lower left panel), and children can not be manipulated
-
-

Change Creation/Tab Order

-Use the control list in lower left panel to drag and drop order
+ ((instructions :reader instructions) (span-13 :reader span-13) + (image-12 :reader image-12))) +(defun create-quick-start + (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) + (let ((panel + (change-class + (clog:create-div clog-obj :content + "\"Add CLOG The Common Lisp Omnificent GUI
+

Quick Start

+

Placing Controls

+Placing Controls - Click a control from the control pallets in the top left panel. Click on your panel
+Static Placement - Click a control from the control pallets in the top left panel. Click on your panel while holding down <ctrl/cmd>
+Place as child control - Click the parent control in your panel. Click a control from the control pallets in the top left panel. Click on your panel while holding down <shift>
+Place as static and child control - Click the parent control in your panel. Click a control from the control pallets in the top left panel. Click on your panel while holding down <shift>+<ctrl/cmd>
+
+

Existing Controls as Children

+2 ways:
+1. Click the parent control in your panel. Holding <shift> click the control to make a child.
+2. Use the control list in the lower left to drag and drop holding the <shift> key
+
+

Existing Controls as Static

+Use the positioning property in the property panel
+
+

Access Children Controls

+Double click the parent control, it will freeze (unfreeze by double clicking it in the control list in the lower left panel), and children can not be manipulated
+
+

Change Creation/Tab Order

+Use the control list in lower left panel to drag and drop order
" - :hidden hidden :class class :html-id html-id :auto-place auto-place) 'quick-start))) - (setf (slot-value panel 'Instructions) (attach-as-child clog-obj "CLOGB3865888356" :clog-type 'CLOG:CLOG-DIV :new-id t)) - (setf (slot-value panel 'span-13) (attach-as-child clog-obj "CLOGB3865888354" :clog-type 'CLOG:CLOG-SPAN :new-id t)) - (setf (slot-value panel 'image-12) (attach-as-child clog-obj "CLOGB3865888353" :clog-type 'CLOG:CLOG-IMG :new-id t)) + :hidden hidden :class class :html-id html-id + :auto-place auto-place) + 'quick-start))) + (setf (slot-value panel 'instructions) + (attach-as-child clog-obj "CLOGB3868051570" :clog-type + 'clog:clog-div :new-id t)) + (setf (slot-value panel 'span-13) + (attach-as-child clog-obj "CLOGB3868051568" :clog-type + 'clog:clog-span :new-id t)) + (setf (slot-value panel 'image-12) + (attach-as-child clog-obj "CLOGB3868051567" :clog-type + 'clog:clog-img :new-id t)) panel)) diff --git a/tools/sys-browser.lisp b/tools/sys-browser.lisp index 4bf2911..2a52b5d 100644 --- a/tools/sys-browser.lisp +++ b/tools/sys-browser.lisp @@ -1,102 +1,151 @@ (in-package "CLOG-TOOLS") (defclass sys-browser (clog:clog-panel) - ( (file-name :reader file-name) - (eval-sel-button :reader eval-sel-button) - (eval-button :reader eval-button) - (save-button :reader save-button) - (search-box :reader search-box) - (class-only :reader class-only) - (label-class-only :reader label-class-only) - (status-box :reader status-box) - (src-box :reader src-box) - (doc-box :reader doc-box) - (class-box :reader class-box) - (package-box :reader package-box) - (type-box :reader type-box) -(classes :accessor classes) (fname :accessor fname) (state :accessor state :initform t))) -(defun create-sys-browser (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) - (let ((panel (change-class (clog:create-div clog-obj :content "
status
 
" - :hidden hidden :class class :html-id html-id :auto-place auto-place) 'sys-browser))) - (setf (slot-value panel 'file-name) (attach-as-child clog-obj "CLOGB3868026239" :clog-type 'CLOG:CLOG-DIV :new-id t)) - (setf (slot-value panel 'eval-sel-button) (attach-as-child clog-obj "CLOGB3868026238" :clog-type 'CLOG:CLOG-FORM-ELEMENT :new-id t)) - (setf (slot-value panel 'eval-button) (attach-as-child clog-obj "CLOGB3868026237" :clog-type 'CLOG:CLOG-FORM-ELEMENT :new-id t)) - (setf (slot-value panel 'save-button) (attach-as-child clog-obj "CLOGB3868026236" :clog-type 'CLOG:CLOG-FORM-ELEMENT :new-id t)) - (setf (slot-value panel 'search-box) (attach-as-child clog-obj "CLOGB3868026235" :clog-type 'CLOG:CLOG-FORM-ELEMENT :new-id t)) - (setf (slot-value panel 'class-only) (attach-as-child clog-obj "CLOGB3868026234" :clog-type 'CLOG:CLOG-FORM-ELEMENT :new-id t)) - (setf (slot-value panel 'label-class-only) (attach-as-child clog-obj "CLOGB3868026233" :clog-type 'CLOG:CLOG-LABEL :new-id t)) - (setf (slot-value panel 'status-box) (attach-as-child clog-obj "CLOGB3868026232" :clog-type 'CLOG:CLOG-DIV :new-id t)) - (setf (slot-value panel 'src-box) (attach-as-child clog-obj "CLOGB3868026231" :clog-type 'CLOG-ACE:CLOG-ACE-ELEMENT :new-id t)) - (setf (slot-value panel 'doc-box) (attach-as-child clog-obj "CLOGB3868026230" :clog-type 'CLOG:CLOG-TEXT-AREA :new-id t)) - (setf (slot-value panel 'class-box) (attach-as-child clog-obj "CLOGB3868026229" :clog-type 'CLOG:CLOG-SELECT :new-id t)) - (setf (slot-value panel 'package-box) (attach-as-child clog-obj "CLOGB3868026228" :clog-type 'CLOG:CLOG-SELECT :new-id t)) - (setf (slot-value panel 'type-box) (attach-as-child clog-obj "CLOGB3868026227" :clog-type 'CLOG:CLOG-SELECT :new-id t)) - (let ((target (type-box panel))) (declare (ignorable target)) (add-select-options target '(ALIEN-TYPE - CALLABLE - CLASS - COMPILER-MACRO - CONDITION - CONSTANT - DECLARATION - DEFINITION - FUNCTION - GENERIC-FUNCTION - GLOBAL-DEFINITION - IR1-CONVERT - MACRO - METHOD - METHOD-COMBINATION - OPTIMIZER - SETF-EXPANDER - SOURCE-TRANSFORM - SPECIAL-OPERATOR - STRUCTURE - SYMBOL-MACRO - TRANSFORM - TYPE - TYPE-DEFINITION - VARIABLE - VOP)) -(setf (value target) "CALLABLE") - ) - (let ((target (package-box panel))) (declare (ignorable target)) (dolist (p (sort (list-all-packages) (lambda (a b) - (string-lessp (package-name a) - (package-name b))))) - (add-select-option target (package-name p) - (package-name p))) -(setf (value target) "CLOG-USER") -(sys-browser-populate panel)) - (let ((target (src-box panel))) (declare (ignorable target)) (clog-ace:attach-clog-ace target) -(setf (clog-ace:theme target) "ace/theme/xcode") -(setf (clog-ace:mode target) "ace/mode/lisp") -(setf (clog-ace:tab-size target) 2)(setup-lisp-ace target (status-box panel))) - (let ((target (label-class-only panel))) (declare (ignorable target)) (setf (attribute target "for") (clog:js-query target "$('[data-clog-name=\\'class-only\\']').attr('id')"))) - (clog:set-on-change (type-box panel) (lambda (target) (declare (ignorable target)) (sys-browser-populate panel))) - (clog:set-on-change (package-box panel) (lambda (target) (declare (ignorable target)) (sys-browser-populate panel))) - (clog:set-on-change (class-box panel) (lambda (target) (declare (ignorable target)) (sys-browser-select panel target))) - (clog:set-on-input (src-box panel) (lambda (target) (declare (ignorable target)) (unless (state panel) - (when (fname panel) - (setf (state panel) t) - (setf (disabledp (save-button panel)) nil))))) - (clog:set-on-change (class-only panel) (lambda (target) (declare (ignorable target)) (sys-browser-populate panel))) - (clog:set-on-key-up (search-box panel) (lambda (target data) (declare (ignorable target data)) (sys-browser-populate panel))) - (clog:set-on-click (save-button panel) (lambda (target) (declare (ignorable target)) (when (fname panel) - (write-file (text-value (src-box panel)) (fname panel)) - (setf (state panel) nil) - (setf (disabledp (save-button panel)) t)))) - (clog:set-on-click (eval-button panel) (lambda (target) (declare (ignorable target)) (let ((val (text-value (src-box panel)))) - (unless (equal val "") - (let ((result (capture-eval val :clog-obj panel - :eval-in-package (text-value (package-box panel))))) - (clog-web-alert (connection-body clog-obj) "Result" - (format nil "~&result: ~A" result) - :color-class "w3-green" - :time-out 3)))))) - (clog:set-on-click (eval-sel-button panel) (lambda (target) (declare (ignorable target)) (let ((val (clog-ace:selected-text (src-box panel)))) - (unless (equal val "") - (let ((result (capture-eval val :clog-obj panel - :eval-in-package (text-value (package-box panel))))) - (clog-web-alert (connection-body clog-obj) "Result" - (format nil "~&result: ~A" result) - :color-class "w3-green" - :time-out 3)))))) + ((file-name :reader file-name) + (eval-sel-button :reader eval-sel-button) + (eval-button :reader eval-button) (save-button :reader save-button) + (search-box :reader search-box) (class-only :reader class-only) + (label-class-only :reader label-class-only) + (status-box :reader status-box) (src-box :reader src-box) + (doc-box :reader doc-box) (class-box :reader class-box) + (package-box :reader package-box) (type-box :reader type-box) + (classes :accessor classes) (fname :accessor fname) + (state :accessor state :initform t))) +(defun create-sys-browser + (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) + (let ((panel + (change-class + (clog:create-div clog-obj :content + "
status
 
" + :hidden hidden :class class :html-id html-id + :auto-place auto-place) + 'sys-browser))) + (setf (slot-value panel 'file-name) + (attach-as-child clog-obj "CLOGB3868051294" :clog-type + 'clog:clog-div :new-id t)) + (setf (slot-value panel 'eval-sel-button) + (attach-as-child clog-obj "CLOGB3868051293" :clog-type + 'clog:clog-form-element :new-id t)) + (setf (slot-value panel 'eval-button) + (attach-as-child clog-obj "CLOGB3868051292" :clog-type + 'clog:clog-form-element :new-id t)) + (setf (slot-value panel 'save-button) + (attach-as-child clog-obj "CLOGB3868051291" :clog-type + 'clog:clog-form-element :new-id t)) + (setf (slot-value panel 'search-box) + (attach-as-child clog-obj "CLOGB3868051290" :clog-type + 'clog:clog-form-element :new-id t)) + (setf (slot-value panel 'class-only) + (attach-as-child clog-obj "CLOGB3868051289" :clog-type + 'clog:clog-form-element :new-id t)) + (setf (slot-value panel 'label-class-only) + (attach-as-child clog-obj "CLOGB3868051288" :clog-type + 'clog:clog-label :new-id t)) + (setf (slot-value panel 'status-box) + (attach-as-child clog-obj "CLOGB3868051287" :clog-type + 'clog:clog-div :new-id t)) + (setf (slot-value panel 'src-box) + (attach-as-child clog-obj "CLOGB3868051286" :clog-type + 'clog-ace:clog-ace-element :new-id t)) + (setf (slot-value panel 'doc-box) + (attach-as-child clog-obj "CLOGB3868051285" :clog-type + 'clog:clog-text-area :new-id t)) + (setf (slot-value panel 'class-box) + (attach-as-child clog-obj "CLOGB3868051284" :clog-type + 'clog:clog-select :new-id t)) + (setf (slot-value panel 'package-box) + (attach-as-child clog-obj "CLOGB3868051283" :clog-type + 'clog:clog-select :new-id t)) + (setf (slot-value panel 'type-box) + (attach-as-child clog-obj "CLOGB3868051282" :clog-type + 'clog:clog-select :new-id t)) + (let ((target (type-box panel))) + (declare (ignorable target)) + (add-select-options target + '(alien-type callable class compiler-macro condition constant + declaration definition function generic-function global-definition + ir1-convert macro method method-combination optimizer setf-expander + source-transform special-operator structure symbol-macro transform + type type-definition variable vop)) + (setf (value target) "CALLABLE")) + (let ((target (package-box panel))) + (declare (ignorable target)) + (dolist + (p + (sort (list-all-packages) + (lambda (a b) + (string-lessp (package-name a) (package-name b))))) + (add-select-option target (package-name p) (package-name p))) + (setf (value target) "CLOG-USER") + (sys-browser-populate panel)) + (let ((target (src-box panel))) + (declare (ignorable target)) + (clog-ace:attach-clog-ace target) + (setf (clog-ace:theme target) "ace/theme/xcode") + (setf (clog-ace:mode target) "ace/mode/lisp") + (setf (clog-ace:tab-size target) 2) + (setup-lisp-ace target (status-box panel))) + (let ((target (label-class-only panel))) + (declare (ignorable target)) + (setf (attribute target "for") + (clog:js-query target + "$('[data-clog-name=\\'class-only\\']').attr('id')"))) + (clog:set-on-change (type-box panel) + (lambda (target) + (declare (ignorable target)) + (sys-browser-populate panel))) + (clog:set-on-change (package-box panel) + (lambda (target) + (declare (ignorable target)) + (sys-browser-populate panel))) + (clog:set-on-change (class-box panel) + (lambda (target) + (declare (ignorable target)) + (sys-browser-select panel target))) + (clog:set-on-input (src-box panel) + (lambda (target) + (declare (ignorable target)) + (unless (state panel) + (when (fname panel) + (setf (state panel) t) + (setf (disabledp (save-button panel)) nil))))) + (clog:set-on-change (class-only panel) + (lambda (target) + (declare (ignorable target)) + (sys-browser-populate panel))) + (clog:set-on-key-up (search-box panel) + (lambda (target data) + (declare (ignorable target data)) + (sys-browser-populate panel))) + (clog:set-on-click (save-button panel) + (lambda (target) + (declare (ignorable target)) + (when (fname panel) + (write-file (text-value (src-box panel)) + (fname panel)) + (setf (state panel) nil) + (setf (disabledp (save-button panel)) t)))) + (clog:set-on-click (eval-button panel) + (lambda (target) + (declare (ignorable target)) + (let ((val (text-value (src-box panel)))) + (unless (equal val "") + (let ((result + (capture-eval val :clog-obj panel + :eval-in-package + (text-value (package-box panel))))) + (clog-web-alert (connection-body clog-obj) + "Result" (format nil "~&result: ~A" result) + :color-class "w3-green" :time-out 3)))))) + (clog:set-on-click (eval-sel-button panel) + (lambda (target) + (declare (ignorable target)) + (let ((val (clog-ace:selected-text (src-box panel)))) + (unless (equal val "") + (let ((result + (capture-eval val :clog-obj panel + :eval-in-package + (text-value (package-box panel))))) + (clog-web-alert (connection-body clog-obj) + "Result" (format nil "~&result: ~A" result) + :color-class "w3-green" :time-out 3)))))) panel)) diff --git a/tools/threads.lisp b/tools/threads.lisp index 9466368..9dd745c 100644 --- a/tools/threads.lisp +++ b/tools/threads.lisp @@ -1,19 +1,26 @@ (in-package "CLOG-TOOLS") -(defclass thread-list (clog:clog-panel) - ( (w3-table-1 :reader w3-table-1) -)) -(defun create-thread-list (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) - (let ((panel (change-class (clog:create-div clog-obj :content "
" - :hidden hidden :class class :html-id html-id :auto-place auto-place) 'thread-list))) - (setf (slot-value panel 'w3-table-1) (attach-as-child clog-obj "CLOGB3867860624" :clog-type 'CLOG:CLOG-TABLE :new-id t)) - (let ((target (w3-table-1 panel))) (declare (ignorable target)) (loop - (let ((threads (swank:list-threads))) - (dolist (thread threads) - (let ((tr (create-table-row target))) - (create-table-column tr :content (second thread)) - (create-table-column tr :content (third thread))))) - (sleep 1) - (setf (inner-html target) "") - (unless (visiblep target) - (return)))) +(defclass thread-list (clog:clog-panel) ((w3-table-1 :reader w3-table-1))) +(defun create-thread-list + (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) + (let ((panel + (change-class + (clog:create-div clog-obj :content + "
" + :hidden hidden :class class :html-id html-id + :auto-place auto-place) + 'thread-list))) + (setf (slot-value panel 'w3-table-1) + (attach-as-child clog-obj "CLOGB3868051588" :clog-type + 'clog:clog-table :new-id t)) + (let ((target (w3-table-1 panel))) + (declare (ignorable target)) + (loop + (let ((threads (swank:list-threads))) + (dolist (thread threads) + (let ((tr (create-table-row target))) + (create-table-column tr :content (second thread)) + (create-table-column tr :content (third thread))))) + (sleep 1) + (setf (inner-html target) "") + (unless (visiblep target) (return)))) panel))