<div dir="ltr">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.<div><br></div><div style>Thanks for finding the obvious mistake.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Dec 30, 2012 at 9:57 AM, Matthew Flatt <span dir="ltr"><<a href="mailto:mflatt@cs.utah.edu" target="_blank">mflatt@cs.utah.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Did you mean to include<br>
<br>
(send frame show #t)<br>
<br>
in the function for `application-file-handler'?<br>
<br>
I get a frame when I add that.<br>
<div><div class="h5"><br>
At Sun, 30 Dec 2012 09:04:36 -0800, Eric Dobson wrote:<br>
> I'm trying to make an application on os X and get it to respond to drag and<br>
> drop/giving it a file. But I cannot get either<br>
> application-start-empty-handler or application-file-handler to get called.<br>
> Am I doing something wrong? The documentation says that they should be<br>
> called. It also says that the arguments are passed into the current command<br>
> line arguments, but that also doesn't seem to be done.<br>
><br>
> My program. (tmp.rkt)<br>
><br>
> #lang racket/gui<br>
><br>
> (application-start-empty-handler<br>
> (λ ()<br>
> (define frame (new frame% (label "start")))<br>
> (define label (new message% (label "hello") (parent frame)))<br>
> (void)))<br>
><br>
> (application-file-handler<br>
> (λ (file)<br>
> (define frame (new frame% (label "file")))<br>
> (define label (new message% (label (format "~a" file)) (parent frame)))<br>
> (void)))<br>
><br>
> (define frame (new frame% (label "tmp")))<br>
> (define label (new message% (label (format "~a"<br>
> (current-command-line-arguments))) (parent frame)))<br>
> (send frame show #t)<br>
><br>
><br>
> Built with:<br>
> raco exe --gui -l tmp.rkt<br>
><br>
> Tried opening app with 'tmp.rkt' as an argument:<br>
> open -a tmp.app tmp.rkt<br>
> and<br>
> right clicking tmp.rkt, and selecting open with tmp.app<br>
><br>
> This always resulted in just the 'tmp' frame being created with the empty<br>
> vector message. I know racket can do this because DrRacket works with this<br>
> on my system.<br>
</div></div>> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br></div>