Mere formatting tweaks

This commit is contained in:
Jaidyn Ann 2024-02-05 15:50:59 -06:00
parent 65e48e7f2d
commit 508a86325e

View File

@ -1,4 +1,4 @@
;; Copyright © 2023, Jaidyn Ann <jadedctrl@posteo.at>
;; Copyright © 2024 Jaidyn Ann <jadedctrl@posteo.at>
;;
;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@ -20,8 +20,8 @@
;; Start & run the application.
(define (init)
(let ([qt-app (qt:init)]
[qt-win (create-window)])
(let [(qt-app (qt:init))
(qt-win (create-window))]
(init-window qt-win)
(qt:run)))
@ -55,32 +55,32 @@
;; Connect callback functions to menubar items.
(define (menubar-callbacks window)
(let* ([fileexit (qt:find window "actionQuit")]
[filesave (qt:find window "actionSave")])
(let* [(menu-file-exit (qt:find window "actionQuit"))
(menu-file-save (qt:find window "actionSave"))]
;; We connect to https://doc.qt.io/qt-6/qaction.html#triggered
(if fileexit
(if menu-file-exit
(qt:connect
fileexit "triggered()"
menu-file-exit "triggered()"
(qt:receiver exit)))
(if filesave
(if menu-file-save
(qt:connect
filesave "triggered()"
menu-file-save "triggered()"
(qt:receiver
(lambda ()
(qt:message "Saving is not implemented." "Saving")))))))
(qt:message "Saving is not implemented.")))))))
;; Connect a text-printing callback to each textbox.
(define (textbox-callbacks window)
(let* ([property-names
'("address" "city" "company" "county" "eMail" "fax"
(let* [(property-names
'("address" "city" "company" "country" "eMail" "fax"
"homePhone" "name" "nickname" "state" "url"
"workPhone" "zip")]
[textboxes
"workPhone" "zip"))
(textboxes
;; The texbox widgets are all named like “countryLineEdit”.
(map (lambda (property)
(qt:find window (conc property "LineEdit")))
property-names)])
property-names))]
;; Cycle through each textbox, connecting them to a callback that prints
;; their contents each time you type in text.
(map (lambda (textbox)
@ -92,9 +92,9 @@
(qt:connect textbox "textChanged(QString)"
(qt:receiver
(lambda ()
(let ([filesave (qt:find window "actionSave")])
(if filesave
(set! (qt:property filesave "enabled") #t)))
(let [(menu-file-save (qt:find window "actionSave"))]
(if menu-file-save
(set! (qt:property menu-file-save "enabled") #t)))
(print (qt:property textbox "text")))))))
textboxes)))