[squeak-dev] iPhone 1.07

John M McIntosh johnmci at smalltalkconsulting.com
Tue Oct 28 23:28:02 UTC 2008


I'm not sure this is accurate if I do

open Squeak.app Squeakx.image

Then with the carbon VM I get the VM launched which then asks me for  
an image via the file selection navigation services,
AND I get a copy of the VM launched which opens the Squeakx.image.  
This is because the Squeak.app runs, then the
Squeakx.image sends an open document request to the VM which then  
looks at the *.image and invokes some applescript to
launch a copy of the VM with the *.image.

This logic was developed a few years back to solve the problem of  
double-clicking
on the a image file and it would open file browser in the running  
squeak.image which wasn't exactly what a person wanted.

I note that saying

open -a Squeak.app Squeakx.image

does the right thing since it asks to open Squeakx.image with the  
application Squeak.app

Now if I do
open -a Squeak\ VM\ Opt.app Squeakx.image test.st

then that starts the application, opens the image, and then opens the  
test.st in a file edit browser, well not what we want either.

In looking at the issue for historical reasons I've done a cwd to the  
VM path when the app starts. If I remove that

./Development/Squeak.app/Contents/MacOS/Squeak\ VM\ Opt ./Development/ 
Squeakx.image test.st

Well that works as desired, now I wonder about side-effects...

Ok well it won't open the Squeak.image that is found in the same  
directory as the Squeak.app if you launch from the Dock because
the cwd isn't done and I'd guess cwd points to '/'   So let me add a  
change to check for no '.' or '/'  on the image name means look in VM  
directory,
so the default Squeak.image  turns into a search for /Application/ 
Squeak.image if Squeak.app is in /Application/

Yes that works.

Ok I'll push out a 3.8.19beta1U   for testing


On Oct 28, 2008, at 10:08 AM, Eliot Miranda wrote:

>
>
> On Tue, Oct 28, 2008 at 12:10 AM, stephane ducasse <stephane.ducasse at free.fr 
> > wrote:
> Thanks john
>
> BTW I have a request for the mac VM
>
> Since I would like to use Squeak as a scripting language I would  
> really like to be able to do
>        squeak image file
> right now I have to pass the full pathname of image and file.
> Would it be possible to get that?
>
> I think the answer for the VM application is no because Mac OS X  
> opens applications in /.
> So the VM cannot find the image unless given a full pathname and  
> cannot find file unless given a full pathname either since the image  
> won't be in the same directory as the image file.
>
> But it is trivial to write a shell script to wrapper the VM that  
> supplies the full pathnames, e.g.
>
> ----8<---squeak---8<---
> #!/bin/sh
> open /Applications/SqueakFoo.app /Applications/SqueakFoo.app/ 
> Resources/Scripting.image "`pwd`/$1"
> ----8<---squeak---8<---
>
> and then have Scripting.image change its working directory to that  
> of the file argument, not the image.
>
>
> I currently run from the command line using the attached  
> CommandLineLauncher via e.g.
>
> ../stackvm/macbuild/Qwaq\ VM.app/Contents/MacOS/Qwaq\ VM ~/Qwaq/Cog/ 
> Benchmarks/stck-1.2.21.image -doit "UnixProcess stdOut nextPutAll:  
> 'Hello world!'; nl"
> Hello world!
>
>
>
>
> Thanks
>
> Stef
>
>
> On Oct 28, 2008, at 1:08 AM, John M McIntosh wrote:
>
> I've push out an iPhone 1.07 VM.   http://www.smalltalkconsulting.com/squeak.html
>
> This VM uses the latest core Pharo image.
>
> The VM has a number of changes to enable C data structure support  
> and code examples for
> putting up a UITextEdit and UITextView for single and multiple line  
> textual input, along with
> the ability to execute objective-c methods on the main thread versus  
> the squeak thread.
> There is of course a new ObjectiveCPlugin for os-x users.
>
> For developers the key to getting a UITextEdit field to work is that  
> you *must* create the UITextEdit
> thread on the main thread, otherwise if you create the object on the  
> squeak thread, then attempt to
> use it for textual input on the main thread as per recommendations  
> it deadlocks on a semaphore when it
> decides that the two process threads are different.
>
> Still to do is finishing the Keyboard entry logic, (oh I'm sure just  
> a few minutes should do it...). Then
> I'll see if I can get a Menu control example working
>
> I've not included the VNC logic since I don't know if anyone uses  
> it, or if it can be integrated into the
> Pharo image at this time, however I suspect someone will let me know.
>
> --
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> John M. McIntosh <johnmci at smalltalkconsulting.com>
> Corporate Smalltalk Consulting Ltd.  http:// 
> www.smalltalkconsulting.com
> = 
> = 
> = 
> = 
> = 
> ======================================================================
>
>
>
>
>
>
>
>
> <CommandLineLauncher.st>

--
= 
= 
= 
========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= 
= 
= 
========================================================================






More information about the Squeak-dev mailing list