[racket] Applications on OS X

From: Eric Dobson (eric.n.dobson at gmail.com)
Date: Sun Dec 30 12:04:36 EST 2012

I'm trying to make an application on os X and get it to respond to drag and
drop/giving it a file. But I cannot get either
application-start-empty-handler or application-file-handler to get called.
Am I doing something wrong? The documentation says that they should be
called. It also says that the arguments are passed into the current command
line arguments, but that also doesn't seem to be done.

My program. (tmp.rkt)

#lang racket/gui

(application-start-empty-handler
  (λ ()
    (define frame (new frame% (label "start")))
    (define label (new message% (label "hello") (parent frame)))
    (void)))

(application-file-handler
  (λ (file)
    (define frame (new frame% (label "file")))
    (define label (new message% (label (format "~a" file)) (parent frame)))
    (void)))

(define frame (new frame% (label "tmp")))
(define label (new message% (label (format "~a"
(current-command-line-arguments))) (parent frame)))
(send frame show #t)


Built with:
raco exe --gui -l tmp.rkt

Tried opening app with 'tmp.rkt' as an argument:
open -a tmp.app tmp.rkt
and
right clicking tmp.rkt, and selecting open with tmp.app

This always resulted in just the 'tmp' frame being created with the empty
vector message. I know racket can do this because DrRacket works with this
on my system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121230/9116c339/attachment.html>

Posted on the users mailing list.