Created
June 11, 2009 19:59
-
-
Save lholden/128189 to your computer and use it in GitHub Desktop.
Simple gui app in scheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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