On 27.08.2008, at 10:00, Fabien Costantini wrote:

>> The files get passed in Apple events and not on the command-line.
>> You can't pass actual command-line arguments to the program...
> Alas true,even when adding cmd arguments in the -a program string  
> like -a"/Applications/MyApp -opt", open doesn't parse the options.

Apple applications differ from Linux and Windows in that the normally  
don't get launched twice, even if you double-click them twice. OS X  
expects that an app can handle multiple documents, so opening another  
instance of an ap merely opens a new document, but not a new app. (You  
can still open the same app twice from the command line, but not from  
the desktop).

So sending command line arguments to "main" is no good when launching  
the second instance, simply because "main" is only called once at  
launch. Instead, OS X sends an Apple Event to the already running  
application, requesting it to open another doc. FLTK supports that  
with the "void fl_open_callback(void (*cb)(const char *))" interface.  
This still does not allow passing of command line flags, though.

Matthias

----
http://robowerk.com/


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to