#lang racket
(require racket/gui/base)
(require db)

(define db (sqlite3-connect #:database "recipes.db"))
(define pngs
  [for/hash [[[item png] (in-query db "select rowid, image from image")]]
    (values item png)])






(define (update text-field event)
  (let ([text (send (send text-field get-editor) get-text)])
    (display text)
    (newline)))

[define bitmaps
  [hash-map/copy
   pngs
   [λ (item png)
     [let [(img [make-object bitmap% [open-input-bytes png]])]
       [values item img]]]]]

(define frame (new frame% [label "Example"]))
(define text-field (new text-field% [label "TEXT"] [parent frame] [callback update]))
(define container (new vertical-pane% [parent frame]))
;(send frame show #t)