basic layout and text interaction
This commit is contained in:
parent
47b5a27d8a
commit
4544fbe54b
28
main.rkt
Normal file
28
main.rkt
Normal file
|
@ -0,0 +1,28 @@
|
|||
#lang racket/gui
|
||||
(require racket/gui/easy
|
||||
racket/gui/easy/operator)
|
||||
|
||||
(define mono (send the-font-list find-or-create-font 12 'modern 'normal 'normal))
|
||||
(define/obs @log "Test field\n")
|
||||
(define/obs @input "Type here...")
|
||||
|
||||
(define (text-entered event content)
|
||||
(when (eqv? event 'return)
|
||||
(:= @log (~a (obs-peek @log) (obs-peek @input) "\n"))))
|
||||
|
||||
(render
|
||||
(window
|
||||
(hpanel
|
||||
(vpanel
|
||||
(input @log
|
||||
#:enabled? #f
|
||||
#:style '(multiple)
|
||||
#:min-size '(600 400)
|
||||
#:font mono)
|
||||
(input @input
|
||||
text-entered
|
||||
#:enabled? #t
|
||||
#:style '(single)
|
||||
#:font mono))
|
||||
(vpanel
|
||||
))))
|
Loading…
Reference in a new issue