clog:parent returns parent object used to create the clog-obj

This commit is contained in:
David Botton 2024-04-12 13:36:40 -04:00
parent aa0e567ae4
commit 9e5f9184d7
5 changed files with 68 additions and 46 deletions

View file

@ -17,19 +17,23 @@
(on-open-console panel)))
(defun repl-on-commmand (panel target data)
(if (equalp data "(clog-builder-repl)")
(let* ((*default-title-class* *builder-title-class*)
(*default-border-class* *builder-border-class*)
(win (create-gui-window panel :title "CLOG Builder REPL GUI Window"
:height 400 :width 600
:has-pinner t
:client-movement *client-side-movement*)))
(setf clog-user::*body* (window-content win)))
(multiple-value-bind (result new-package)
(capture-eval data :clog-obj panel
:capture-console (not *clog-repl-use-console*)
:capture-result (not *clog-repl-send-result-to-console*)
: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))))
(cond ((or (equalp data ":e")
(equalp data ":q"))
(window-close (parent (parent panel))))
((equalp data "(clog-builder-repl)")
(let* ((*default-title-class* *builder-title-class*)
(*default-border-class* *builder-border-class*)
(win (create-gui-window panel :title "CLOG Builder REPL GUI Window"
:height 400 :width 600
:has-pinner t
:client-movement *client-side-movement*)))
(setf clog-user::*body* (window-content win))))
(t
(multiple-value-bind (result new-package)
(capture-eval data :clog-obj panel
:capture-console (not *clog-repl-use-console*)
:capture-result (not *clog-repl-send-result-to-console*)
: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)))))