qml-old/examples/helloworld.scm

35 lines
996 B
Scheme

(import
(qml core)
coops)
(gui-application-create)
(define engine (make <QQmlApplicationEngine>))
(define (windowLoadCallback cbdata argv) void
(print cbdata)
(print "Loaded QML file: " (to (cadr argv) string:)))
(define (textChangeCallback cbdata argv) void
(print cbdata))
(define callback-data "Test")
(define textchange-cbdata "Text Edited")
(define conn (connect engine "objectCreated(QObject*,QUrl)"
windowLoadCallback
callback-data
(qt-connection-type auto:)))
(define loc (new-QUrl "examples/helloworld.qml"))
(load-url engine loc)
(define nameInputField (find-child (root engine) "nameInputField"))
(define conn2 (connect nameInputField "textEdited()"
textChangeCallback
textchange-cbdata
(qt-connection-type auto:)))
(do ((loop #t))
((not loop) #t)
(process-events-timed (qevent-loop-process-event-flag process-all-events:) 50))