Display REPL and provide remote-REPL
Helping testing/debugging/tweaking.
This commit is contained in:
parent
508a86325e
commit
a06bd33f9d
30
contact.scm
30
contact.scm
|
@ -14,16 +14,39 @@
|
||||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
(import (chicken io)
|
(import (chicken io)
|
||||||
|
(chicken repl)
|
||||||
(chicken string)
|
(chicken string)
|
||||||
|
(chicken time)
|
||||||
|
srfi-18
|
||||||
|
nrepl
|
||||||
qt-light)
|
qt-light)
|
||||||
|
|
||||||
|
|
||||||
|
(define qt-app #f) ;; The <qt-application> object.
|
||||||
|
(define qt-win #f) ;; The <qt-window> object.
|
||||||
|
|
||||||
|
|
||||||
;; Start & run the application.
|
;; Start & run the application.
|
||||||
(define (init)
|
(define (init)
|
||||||
(let [(qt-app (qt:init))
|
;; Set up some global state, prepare the QT app.
|
||||||
(qt-win (create-window))]
|
(set! qt-app (qt:init))
|
||||||
|
(set! qt-win (create-window))
|
||||||
(init-window qt-win)
|
(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 QT’s processing, again and again.
|
||||||
|
(define (qt-loop)
|
||||||
|
(qt:run #t)
|
||||||
|
(qt-loop))
|
||||||
|
|
||||||
|
|
||||||
;; Create the application window.
|
;; Create the application window.
|
||||||
|
@ -52,7 +75,6 @@
|
||||||
(textbox-callbacks window))
|
(textbox-callbacks window))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; Connect callback functions to menubar items.
|
;; Connect callback functions to menubar items.
|
||||||
(define (menubar-callbacks window)
|
(define (menubar-callbacks window)
|
||||||
(let* [(menu-file-exit (qt:find window "actionQuit"))
|
(let* [(menu-file-exit (qt:find window "actionQuit"))
|
||||||
|
|
Ŝarĝante…
Reference in New Issue