// *** Copyright (c)2003 Jim Massey. All rights reserved  ***********
// *** massey@stlouis-shopper.com **************
// *** No Warranty - certified to work with nothing ***
// *** developed to work with mozilla kiosk **** 

The cmdline module allows you to start programs from xul documents. The cmdlineOverlay.xul brings in the startProc.js that does the work.

The startProc.js starts or stops a defined process using passed in variables. It requires atleast 1 argument and at most 3 arguments. The order of the arguments is significant. All parameters are passed as strings.

procArgs[0] - is the command line full path to program wanted

procArgs[1] - contains the startup arguments that should be passed to the program wanted.

blockingBool - a boolean for process blocking or not and a false or null value indicates no blocking. Any assignment will make blockingBool evaulate to true.

This example xul snippet shows a few menuitems that call the startProc.js init_process() and kill_process() functions with parameters and arguments.
  
   <menuitem label="Ball wav" 
	   oncommand="init_process('/usr/bin/play', '/cdimage/TestA.wav');" />
	<menuitem label="Diann wav"
	   oncommand="init_process('/usr/bin/play', '/cdimage/TestB.wav', 'block');" />
	<menuitem label="Stop Sound Process" 
	   oncommand="kill_process('/usr/bin/killall', 'sox');" />
	<menuitem label="Audio Transcriber" 
	   oncommand="init_process('/home/massey/recorder/recorder.pl');" />
	<menuitem label="Emacs" oncommand="init_process('/usr/bin/emacs');" />
	<menuitem label="Gedit" oncommand="init_process('/usr/bin/gedit');" />
    </menupopup>
  </menu>

Notice that the menuitem labeled 'Diann wav' passes three arguments, the commandline to start the required program, the programs arguments, the blocking boolean set to a value which makes it 'true' so it will block until it finishes execution. Also the menuitem labeled 'Emacs' only passes on one paramter and does not set the second or third arguments. So if you wanted to use blocking you would have to specify all three arguments to 'init_process'

These are linux commandline arguments. This has not been tested on any other platform. But I am sure it will work with the propper paths. Windows or other plaform users feedback is welcome. Contact info is at the top of this file.