how can I make a thing that can be run?

goran at krampe.se goran at krampe.se
Fri Feb 17 07:46:32 UTC 2006


Kendall Shaw <queshaw at pacbell.net> wrote:
> goran at krampe.se wrote:
> > Kendall Shaw <queshaw at pacbell.net> wrote:
> > There are numerous ways to deliver squeak "apps" or code. Project files
> > are used primarily for eToys or "demos" of code.
> > Most projects in the Squeak community are delivered in source form
> > instead, using a variety of file formats:
> > 
> > 	.st (or .st.gz compressed) - the good old fileout of code. Not used
> > much anymore.
> > 	.cs (or .cs.gz compressed) - changesets. They are like patches from the
> > regular world, quite nifty but can be confusing.
> > 	.mcz - Monticello package. This is the "standard" today and is what
> > most people use. The file is a zip file with source in it, in a special
> > format to be loaded by Monticello.
> > 	.sar - This is also a zip file with a code snippet inside for
> > performing the install of the rest of the contents. .mcz files only
> > contain code so a .sar file can be used as a wrapper in order to include
> > other kinds of files too.
> 
> Thanks. This and your other suggestions seem to be about how to package 
> an application. But, what I don't get is how you make something that 
> does something, aside from by a Project.
> 
> For example, with C there is a "main" routine that is the entry point, 
> so that when you have a C program you "run" it, in one uniform way for 
> all programs (more or less) that causes it to "execute".

Again there are numerous options. :) Here are a few:

- If you start an app in an image and then save the image, it will
already be running when the image is restarted.

- If you deliver an image to an enduser you can also start it with
command line arguments. One argument can be an .st file to filein -
which is the same as executing it. So the file can contain just a
snippet of code to execute, just like in a workspace.

- When installing code into the image there are several "hooks" to
actually run something:
	- Class side initialize methods, they are executed when the class is
installed into the image.
	- Changeset files have preambles and postscripts - two optional
snippets of code that are executed before and after the filein.
	- Sar files have as I said a script that gets run when it is
installing.
	- .mcz files I am unsure about, the class initialize methods are of
course run, but not sure if there are other ways too.

In class side initialize methods you can hook up into menues in the
system, hook up into the startUp sequence of the image etc etc.

regards, Göran



More information about the Squeak-dev mailing list