PasteRack.org
Paste # 96293
2020-05-20 23:42:43

Fork as a new paste.

Paste viewed 183 times.


Embed:

  1. (define history '())
  2. (provide refresh-history)
  3. (define (refresh-history)
  4.   (set! history (on-server '(list-history))))
  5.  
  6. (provide add-history)
  7. (define (add-history query)
  8.   (on-server `(add-history ',query))
  9.   (refresh-history))
  10.  
  11. (provide create-history-menu)
  12. (define (create-history-menu parent callback)
  13.   (refresh-history)
  14.   (new menu%
  15.        [label "History"]
  16.        [parent parent]
  17.        [demand-callback
  18.         (λ (m)
  19.           (for ([mi (send m get-items)])
  20.             (send mi delete))
  21.  
  22.           (new menu-item% [parent m]
  23.                [label "Clear History"]
  24.                [callback (λ (b e)
  25.                            (on-server '(clear-history))
  26.                            (refresh-history))])
  27.  
  28.           (new separator-menu-item% [parent m])
  29.  
  30.           (for ([hi (in-list history)])
  31.             (new menu-item% [parent m] [label (~s hi)]
  32.                  [callback (λ (b e) (callback hi))])))]))

=>

load-handler: expected a `module` declaration in "paste 96293", but found something else

Check that paste includes #lang?