[racket] Applications on OS X
Yep, it works as expected with that. And I believe that I misread the
command line arguments part, because that seems like it applies to Windows
not OS X.
Thanks for finding the obvious mistake.
On Sun, Dec 30, 2012 at 9:57 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> Did you mean to include
>
> (send frame show #t)
>
> in the function for `application-file-handler'?
>
> I get a frame when I add that.
>
> At Sun, 30 Dec 2012 09:04:36 -0800, Eric Dobson wrote:
> > 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.
> > ____________________
> > Racket Users list:
> > http://lists.racket-lang.org/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121230/2438b430/attachment.html>