2 ms·
I think Racket has a pretty sensible GUI kit. A little Hello-World dialogue box looks like this: #lang racket/gui (require racket/gui/base) (let*
by JasonFruit 8y ago
I think Racket has a pretty sensible GUI kit. A little Hello-World dialogue box looks like this:
#lang racket/gui
(require racket/gui/base)
(let* ((frame (new frame% (label "Hello, world!")))
(msg (new message% (parent frame)
(label "Hello, world!")))
(btn (new button% (parent frame)
(label "Exit")
(callback (lambda (b evt)
(exit))))))
(send frame show #t))
The first two lines just tell Racket what language you're using, and conjure up the GUI library. Then, each definition of the let statement is a control you need, supplying its properties; the body of the let statement shows the window frame. I find it simple and obvious, but I've only been able to use it in anger a couple times.