[plt-scheme] OSX drag-and-drop

From: Robby Findler (robby at cs.uchicago.edu)
Date: Sun Jan 2 11:31:38 EST 2005

You'll need to override the on-drop-file method of the frame.

To get the stuff dropped on the application to start it up, check in
current-command-line-arguments. 

After the app is started up, dropping something on the app in the
finder calls the on-drop-file method of the frontmost frame.

hth,
Robby

At Sun, 02 Jan 2005 11:26:45 -0500, Matthew Jadud wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> As usual, I'm missing something.
> 
>  From the documentation it seems like I should be able to create a 
> drag-and-drop aware application using MrEd, but I'm not sure what is the 
> right way to proceed after my first, naive attempt.
> 
> I'm aiming for a droplet; it seems like the same mechanism that enables 
> drag-and-drop should lead me to an application that, when embedded in 
> MrEd, will give me a droplet.
> 
> I'll keep digging. My naive attempt does not work under 208 or 299.22. 
> That's not surprising, since I think I'm missing something important.
> 
> Thanks,
> Matt
> 
> (module foo mzscheme
>    (require (lib "mred.ss" "mred")
>             (lib "class.ss"))
> 
>    (define my-frame
>      (new
>       frame%
>       (parent #f)
>       (label "Untitled Frame")
>       (width 400)
>       (height 300)
>       ))
> 
>    (send my-frame accept-drop-files #t)
>    (send my-frame show #t)
>    )



Posted on the users mailing list.