On 30-09-2014, at 3:16 PM, David T. Lewis lewis@mail.msen.com wrote:
On Tue, Sep 30, 2014 at 10:29:20PM +0200, Nicolas Cellier wrote:
A good soul should take a look at Pharo and pick the good bytes from there
Good idea to take a look at the Pharo handling.
Yes, indeed.
But I think the Squeak handling has been pretty much unchanged for quite a while and it does still work. I'm using a unix VM, and there may be some platform differences, but the basic idea is that any command line parameters intended for the VM will be handled by the VM, and you then specify image name followed by document name followed by any other parameters that you may want to pass along to the image. The first thing after the image name is treated as a startup document, so that needs to be present if you intend to also pass along some other parameters. The remaining parameters are available to the image (evaluate "Smalltalk arguments"). Thus you can do something like this:
$ /usr/local/bin/squeak -vm-sound-pulse myImage.image myStartupDocument.st param1 param2 param3
The arguments #('param1' 'param2' 'param3') will be available for use in your myStartupDocument.st start script.
That’s what I thought would be the case. It seems a bit more complex though since some attempted testing dropped me into a problem with AutoStart (which does some fairly involved reading and fiddling with any arguments) passing on to ProjectLauncher>startUp >>>startUpAfterLogin which seems to want to treat any words in the commandline as filepaths and then use a CodeLoader to read them in. For example,` {vm} scratch.image fooble` fails part way through starting up because of an attempt to load `file:///home/pi/Scratch/fooble`.
Scratch expects (and this is documented old stuff that people appear to rely upon so I can’t easily change it, probably) to be able to do `{vm} scratch.image presentation fullscreen myProject.sb` and to get presentation and fullscreen as sort of keywords and the *.sb as a project filename.
As an aside I see that the class ProjectLauncher is only referenced in InstallerCruft class>>classProjectLauncher and InstallerCruft is not referenced at all. And I can’t find any actual code that installs it in AutoStart’s very short list of `InstalledLaunchers` so just possibly it isn’t supposed to be there any more?
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Useful Latin Phrases:- Braccae illae virides cum subucula rosea et tunica Caledonia-quam elenganter concinnatur! = Those green pants go so well with that pink shirt and the plaid jacket!