Display REPL and provide remote-REPL

Helping testing/debugging/tweaking.
This commit is contained in:
Jaidyn Ann 2024-02-05 18:10:17 -06:00
parent 508a86325e
commit a06bd33f9d

View File

@ -14,16 +14,39 @@
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
(import (chicken io)
(chicken repl)
(chicken string)
(chicken time)
srfi-18
nrepl
qt-light)
(define qt-app #f) ;; The <qt-application> object.
(define qt-win #f) ;; The <qt-window> object.
;; Start & run the application.
(define (init)
(let [(qt-app (qt:init))
(qt-win (create-window))]
;; Set up some global state, prepare the QT app.
(set! qt-app (qt:init))
(set! qt-win (create-window))
(init-window qt-win)
(qt:run)))
(let ;; Start QT loop.
[(qt-thread (thread-start! qt-loop))
;; Kick off the remote-REPL…
(nrepl-thread (thread-start! (lambda () (nrepl 1234))))]
;; … and also provide a local REPL.
(repl)
;; Wait for the QT program, even after stdin is closed off.
(thread-join! qt-thread)))
;; Loop through QTs processing, again and again.
(define (qt-loop)
(qt:run #t)
(qt-loop))
;; Create the application window.
@ -52,7 +75,6 @@
(textbox-callbacks window))
;; Connect callback functions to menubar items.
(define (menubar-callbacks window)
(let* [(menu-file-exit (qt:find window "actionQuit"))