#lang racket/gui ;(require racket-tray) (require "../main.rkt") (define simple% (class frame% (super-new [label "Racket Tray"] [width 400] [height 250]) (define lbl (new message% [label "Counting tray clicks"] [parent this] [auto-resize #t] [stretchable-width #t])) (define count 0) (define/public (count-next) (set! count (+ count 1)) (send lbl set-label (format "Counting tray clicks: ~a" count))) )) (define frame (new simple%)) (define tray (mk-tray frame "simple.png" (λ () (send frame count-next) (send frame show #t)))) (tray-set-menu! tray (list (list "Open" (λ () (send frame show #t))) 'separator (list "Exit" (λ () (tray-close tray) (send frame show #f))))) (send frame show #t)