Path for gd.addHelp()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Path for gd.addHelp()

John Dunsmuir
I'm adding help resources to some macros and plugins.

In macros

dir = getDirectory("plugins");
dir = replace(dir,"\\","/");
myURL="file:///"+dir+"FloodFill/FloodFillHelp/FloodFill_Connectivity_Scan.htm";

works OK but I don't know how to fix the pesky backslashes in a plugin. Hard coding the path works but isn't an option for me.

Thanks,
John D.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Path for gd.addHelp()

Rasband, Wayne (NIH/NIMH) [E]
On May 24, 2013, at 2:55 PM, John Dunsmuir wrote:

> I'm adding help resources to some macros and plugins.
>
> In macros
>
> dir = getDirectory("plugins");
> dir = replace(dir,"\\","/");
> myURL="file:///"+dir+"FloodFill/FloodFillHelp/FloodFill_Connectivity_Scan.htm";
>
> works OK but I don't know how to fix the pesky backslashes in a plugin. Hard coding the path works but isn't an option for me.

It would be better to inline the HTML help, as in the example at

    http://imagej.nih.gov/ij/macros/examples/DialogWithHelp.txt

With plugins, the HTML file can be stored in a jar file along with the plugin. The example at

   http://imagej.nih.gov/ij/plugins/pcl-demo.html

demonstrates how resources needed by a plugin, such as text files, can be loaded from a jar file.

-wayne



   

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Path for gd.addHelp()

John Dunsmuir
In reply to this post by John Dunsmuir
Thanks Wayne,  I'll have a look at the jar approach, it should help a lot to keep all of the resources together.  I did solve my original backslash question.

                dir = IJ.getDirectory("plugins");
                dir= dir.replace("\\","/");
                myURL = "file:///"+dir + "FloodFill/FloodFillHelp/myFloodFill_Help.htm";
Regards,
John D.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html