I don't know how relavent this information will be to Jmol, but I know a developer that made a GLUT based application more "Mac-like" by bundling everything together in an ".app" directory. He also was able to make the ldglite.app drag and dropable; that is, a file could be dropped onto the application bundle and the application would open the file. Unfortuanetly, he hasn't been able to get it to work if the application is already running. So, his ldglite.app bundle is drag and droppable at launch but not once it is running. Apparently, the GLUT stuff takes over and there isn't any interaction with the Finder after the application is launched.

Anyway, here is what he had to say...


Hi Chris,


The guy's probably doomed because it's a java applet.  But you never
know, maybe there's some java API on the Mac that'll let him jump
through the same hoops I had to for the glut app.   I've attached a
code snippet that looks for the clue and then calls the code I borrowed
and modified from MacPython and/or Freetype.  My version of the
FTMac_GetArgv(&argv) function is in the ldglite sources in getargv.c.


Don


 // When you double click on a file in the finder it doesn't pass the
 // filename(s) on the command line.  Instead you have to get a hint
 // in the form of a "-psn_*" arg which contains a pid or something
 // like that.  Then you have to jump through the Mac events API
 // to find the filenames.
 //
 // Probably should look for one of those -psn* args before doing this.
 // (glutInit() removes -psn* args, but does not insert the filenames)
 for (i = 1; i < argc; i++)
   if (!strncmp(argv[i], "-psn_", 5))
   {
     needargs = 1;
     break;
   }
 // This replaces all args with stuff from the finder.
 // Assume there will be no other args if if comes from the finder.
 // That may not be the case if I figure out how to get ldglite.command
 // script to call the ldglite executable in the bundle.
 // Maybe I should call the bundled executable l3glite.
 if (needargs)
   argc = FTMac_GetArgv(&argv);

End of copied message.
If any of this stuff meant anything to me I could decide whether or not this is helpful, but it doesn't, so I can't.


Chris


On Mar 23, 2004, at 12:47 PM, Miguel wrote:



After using Jar Bundler to bundle the new Jmol 10 version 7 and then
modifying the plist, I am now able to set all .mol files on my drive to
launch Jmol upon double-clicking according to the procedures
outlined earlier by Tim and me (Get info, etc.).

Good


However, although Jmol now launches upon double-clicking .mol files,
Jmol still doesn't load those files, somewhat defeating the purpose of
double-clicking.

I need some information on how OSX passes parameters to apps that it
launches. A developer who knows a little bit about OSX software
development should be able to easily answer this ... or give me a document
reference in developer.apple.com


Apparently it is not passing the name of the file as a command-line
parameter ... otherwise it would be opening the file.

Dragging the file icon onto the Jmol icon is  also
ineffective.

This is probably exactly the same issue.




Miguel





-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Jmol-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-users




------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Jmol-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to