Mere formatting tweaks
This commit is contained in:
parent
65e48e7f2d
commit
508a86325e
36
contact.scm
36
contact.scm
|
@ -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* ([file→exit (qt:find window "actionQuit")]
|
||||
[file→save (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 file→exit
|
||||
(if menu-file-exit
|
||||
(qt:connect
|
||||
file→exit "triggered()"
|
||||
menu-file-exit "triggered()"
|
||||
(qt:receiver exit)))
|
||||
(if file→save
|
||||
(if menu-file-save
|
||||
(qt:connect
|
||||
file→save "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 ([file→save (qt:find window "actionSave")])
|
||||
(if file→save
|
||||
(set! (qt:property file→save "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)))
|
||||
|
||||
|
|
Ŝarĝante…
Reference in New Issue