basic layout and text interaction

This commit is contained in:
kiefac 2024-05-18 12:11:50 -04:00
parent 47b5a27d8a
commit 4544fbe54b
2 changed files with 29 additions and 0 deletions

View file

@ -1,2 +1,3 @@
# lispjam24
repo for entry to lisp game jam 2024

28
main.rkt Normal file
View 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
))))