diff --git a/beautiful-racket-lib/br/drracket.rkt b/beautiful-racket-lib/br/drracket.rkt new file mode 100644 index 0000000..8c0cb2c --- /dev/null +++ b/beautiful-racket-lib/br/drracket.rkt @@ -0,0 +1,11 @@ +#lang racket/base +(require racket/class + racket/draw) + +(provide (all-defined-out)) +(define (make-drracket-button . args) + (define label (or (findf string? args) "untitled")) + (define bitmap (or (findf (λ(arg) (is-a? arg bitmap%)) args) (make-object bitmap% 16 16))) + (define callback (or (findf procedure? args) (λ(drr-frame) (void)))) + (define number (or (findf (λ(arg) (or (real? arg) (equal? #f arg))) args) #f)) + (list label bitmap callback number))