diff options
author | David Pirotte <david@altosw.be> | 2023-10-23 22:33:50 -0300 |
---|---|---|
committer | David Pirotte <david@altosw.be> | 2023-10-23 22:33:50 -0300 |
commit | 78e5db23f14146cc0461a3b6c5519f956120fc1e (patch) | |
tree | 4499f24c9215336a1548351753718a31e8b801c2 | |
parent | cbc684e69df5f5ee5d65de69852c5d13384bb3ac (diff) |
Adw1-demo review - Support a -d, --debug cmd line option
* examples/adw-1/adw1-demo.scm: Support a -d, --debug cmd line option.
-rwxr-xr-x | examples/adw-1/adw1-demo.scm | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/examples/adw-1/adw1-demo.scm b/examples/adw-1/adw1-demo.scm index 4f3577b..e13d3c5 100755 --- a/examples/adw-1/adw1-demo.scm +++ b/examples/adw-1/adw1-demo.scm @@ -51,9 +51,17 @@ exec guile -e main -s "$0" "$@" (define (main args) - (let ((app (make <adw-application> - #:application-id "org.gnu.g-golf.adw1.demo"))) - (connect app 'activate show-window) - (let ((status (g-application-run app args))) - #;(exit status) - 'done))) + (letrec ((animate + (lambda () + (let ((app (make <adw-application> + #:application-id "org.gnu.g-golf.adw1.demo"))) + (connect app 'activate show-window) + (let ((status (g-application-run app '()))) + #;(exit status) + 'done))))) + ;; a simple -d [--debug] cmd line option detection + (if (or (member "-d" args) + (member "--debug" args)) + (parameterize ((%debug #t)) + (animate)) + (animate)))) |