From ed4d054f3d0e5cbb81b2d57e90edb0ade29b2707 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 21 Dec 2016 14:10:51 -0800 Subject: [PATCH] add drracket module --- beautiful-racket-lib/br/drracket.rkt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 beautiful-racket-lib/br/drracket.rkt 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))