[racket] current-directory in tools/plugins

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Aug 31 08:11:16 EDT 2010

Use `define-runtime-path' to locate a file relative to an enclosing
module's source.

At Tue, 31 Aug 2010 12:54:38 +0100, Stephen De Gabrielle wrote:
> Hi,
> 
> I'm trying to determine the plugin folder at runtime for a plugin I'm
> writing;
> 
> an example of where I'd like this:
> 
>         (define commit-button
>           (new switchable-button%
>                (label "commit")
>                (parent (make-object vertical-pane% (get-button-panel)))
>                (callback fossil-commit-menu-callback)
>                [bitmap (make-object bitmap% "projectmgr.png" 'png #f)]
>                ))
>         (register-toolbar-button commit-button)
> ;
>         ;; my test
>         (dialog (path->string (current-directory)))
>   ;; shows current-directory to be '/'
> 
> The button appears without the image, and my test seems to confirm that the
> plugin is looking to find the PNG in '/' rather than inthe folder where the
> plugin is running from.
> 
> Any hints appreciated, as I can't seem to work this out from the
> documentation.
> 
> Cheers,
> 
> Stephen



Posted on the users mailing list.