Skip to content

Instantly share code, notes, and snippets.

@lholden
Created June 11, 2009 19:59
Show Gist options
  • Save lholden/128189 to your computer and use it in GitHub Desktop.
Save lholden/128189 to your computer and use it in GitHub Desktop.
Simple gui app in scheme
#lang scheme
(require scheme/gui/base)
(require framework)
(application:current-app-name "TestApp")
(preferences:set-default 'TestApp:size-preference '(600 400)
(λ(size) (and (list? size)
(andmap (λ(i) (positive? i)) size))))
(define my-app%
(class (frame:size-pref-mixin (frame:standard-menus-mixin (frame:basic-mixin frame%)))
(inherit get-area-container)
(super-new [size-preferences-key 'TestApp:size-preference]
[label "MyApp"]
[min-width 200]
[min-height 100])
(let* ([window (get-area-container)]
[vpane (new vertical-pane% [parent window] [alignment '(center center)])])
(new message% [parent vpane] [label "Yeah yeah, hello world!"])
(new button% [parent window] [label "Quit"]
[callback (λ(b e) (exit:exit))]))
(frame:reorder-menus this)))
(send (new my-app%) show #t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment