diff options
author | David Thompson <dthompson2@worcester.edu> | 2021-05-03 19:59:47 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2021-05-03 19:59:58 -0400 |
commit | 5a688b2200c0f91e36b791c375761c3158bbacda (patch) | |
tree | 0969e0d557d6a3282a96fe1ad63bceabc9cb20bf | |
parent | c4bcb53934bc9ce0624affe877e2e7a0afa8d053 (diff) |
gui: Add enabled? flag to <widget>.
-rw-r--r-- | starling/gui.scm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/starling/gui.scm b/starling/gui.scm index 256cfd7..4698923 100644 --- a/starling/gui.scm +++ b/starling/gui.scm @@ -41,6 +41,7 @@ current-theme <widget> apply-theme + enabled? focused? hover? left-pressed? @@ -126,6 +127,7 @@ (define current-theme (make-parameter #f)) (define-class <widget> (<node-2d>) + (enabled? #:accessor enabled? #:init-value #t #:watch? #t) (focused? #:accessor focused? #:init-value #f #:watch? #t) (hover? #:accessor hover? #:init-value #f #:watch? #t) (left-pressed? #:accessor left-pressed? #:init-value #f #:watch? #t) @@ -301,7 +303,8 @@ (define-method (pick-widget (scene <gui-scene>) p) (pick scene p (lambda (node) - (and (visible? node) + (and (enabled? node) + (visible? node) (is-a? node <widget>))))) (define-method (on-mouse-move (scene <gui-scene>) x y x-rel y-rel buttons) |