Archive

Archive for the ‘Pharo’ Category

Morphic Vision

September 17th, 2010 2 comments
I was doing a lot of playing with Morphic this week at ESUG in Barcelona.  Many people seem to really not like it and complain about it, but it seems very vague i.e. they can’t point to a specific problem with it.
I think it’s amazingly powerful and universally misunderstood.  Many people are pushing for native widgets for end users, which I think is awesome, but serves a different role.  For me, there are two use cases:
1. People (mostly Smalltalkers, including myself) interested in the UI’s of the future and exploring what’s possible
2. People who love their (e.g. Mac) look and feel or are in a setting (e.g. enterprise) where they have to use a particular GUI.
Morphic seems ideal for group #1.  I think the key questions are:
* if you were implementing Morphic today, knowing what you know after it being used over the years, how would you do it?
* what would it take (if possible) to get there from the current implementation?
Two issues I’ve noticed:
1. there seems to be an explosion of classes with slightly different behavior e.g. TextMorph, TextMorphForShout, PluggableTextMorph, PluggableShoutMorph.
2. I’m not clear whether the hooks for modifying behavior are
a. available in all the right places
b. working
c. widely understood
I’m forming an informal panel to discuss this.  I’ve reached out to Morphic’s creators and some original users.
A quick example of my (seemingly common) experience:
For example, I’m writing an implementorsOf browser that shows the execution path as a graph of MethodMorphs connected by LineMorphs, because the standard paned browser does not capture the metaphor of drilling down through implementors.  So I Created a MethodMorph and added as a submorph a PluggableShoutMorph to hold the code.  At that point, I couldn’t figure out a good/easy way to react to mouse events and pop out a new MethodMorph.
I tried (one of these felt very satisfying):
* Morph>>on:send:to:, which sounded good, but never got called
* intercepting Morph>>processEvent:using: (which I was told was not a good idea)
* (after seeking help), locking the submorphs and overriding the dozen or so event-related methods in the chain from my morph to TextMorphForShout (the Morph that actually handles the text and input).
* subclassing TextMorphForShout and then subclassing PluggableShoutMorph to use that subclass.
Categories: Pharo, Smalltalk, Squeak Tags:

Squeak/Pharo command line scripting

August 9th, 2010 3 comments

UPDATE (5/22/2011): I figured out how to use the “open” command, instead of digging into the bundle. See the “Scripting the Image” section below.

Typical Workflow

I go through a lot of images.  It’s just the way it is – make some changes to a package, try to load it in a fresh image, open another image with an older version to compare.

The Case for Scripting

The frustrating part is not using many images (which is pretty cool – to have multiple computers running at once… but I digress), but setting up the images every time.  So I decided I’d find a way to load common configurations automatically.  But how would I communicate to the image that it should run certain code on startup?  A quick google found writing scripts.

Poor Command of the Mac Command Line

This sounded like just what I needed, but I ran into a bit of trouble with the Mac command line:

~$ open -a /Applications/Squeak\ 4.2.5beta1U
FSPathMakeRef(/Applications/Squeak 4.2.5beta1U) failed with error -43.
~$ open -a Squeak\ 4.2.5beta1U ./Pharo-1.1-scripting/Pharo-1.1-11411dev10.07.1.image
Unable to find application named ‘Squeak 4.2.5beta1U’
~$ /Applications/Squeak\ 4.2.5beta1U ./Pharo-1.1-scripting/Pharo-1.1-11411dev10.07.1.image
-bash: /Applications/Squeak 4.2.5beta1U: No such file or directory
~$ /Applications/Squeak\ 4.2.5beta1U.app ./Pharo-1.1-scripting/Pharo-1.1-11411dev10.07.1.image
-bash: /Applications/Squeak 4.2.5beta1U.app: is a directory

Scripting the Image!

I finally figured out that what I needed to do was use the “–arg” flag with “open”, so:
~$ open -a /Applications/Squeak\ 4.2.5beta1U.app/ –args

./Pharo-1.1-11411dev10.07.1.image /Users/sean/Squeak/SpdImageSetup.st testArgument

Or you could call the actual binary inside the .app bundle (but this opens it in the background):
~$ “/Applications/Squeak 4.2.5beta1U.app/Contents/MacOS/Squeak VM Opt” ./Pharo-1.1-11411dev10.07.1.image /Users/sean/Squeak/SpdImageSetup.st testArgument
And, bingo!  The image opened and filed in the .st file.  The arguments are available with SmalltalkImage>>getSystemAttribute:  So, for example (in Squeak 4.1), “Smalltalk getSystemAttribute: 3″ returned ‘testArgument’

Running the Script Automatically on Startup

The other thing to know is that you cause the filed in code to run automatically by creating a class>>initialize method somewhere in it, which is run immediately after the code is loaded.
Categories: Pharo, Squeak Tags:

windows 7 product key

windows 7 product key

windows 7 key generator

windows 7 key generator

free winrar download

free winrar download

winzip activation code

winzip activation code

free winrar

free winrar

winzip free download

winzip free download

winrar free download

winrar free download

winrar download free

winrar download free

winzip free download full version

winzip free download full version

windows 7 activation crack

windows7 activation crack

windows 7 crack

windows 7 crack

free winzip

free winzip
\n