Squeak Teaching/Learning questions

raymondasselin at sympatico.ca raymondasselin at sympatico.ca
Wed Nov 28 19:58:05 UTC 2001


Jerry Balzano <gjbalzano at ucsd.edu> wrote:
> Where my HyperCard background gets me in trouble with Squeak is when I'm
> repeatedly wanting/trying to "lift the hood" on things to see how they
> work, and my HC experience of how to do this and what you find there is
> just different.  For example, Squeak inspectors on object instances are
> really only the tip of the iceberg, but browsing the class takes me all the
> way to the bottom of the ocean. I need better moves for negotiating the
> middle ground.
> 
> So in HyperCard I could always double-click on a button, see its
> point-clickable properties, and with one more click see the script for how
> that button works.  In Squeak I seem to only be able to see how a button
> works in this way if it has been Etoy-scripted.  Similarly with menu items:
> I'd love to be able to "lift the hood" on one of the many menu items that
> one can access through a morph's halos and peek at the code that implements
> that function. How can I (or anyone else learning Squeak) do this?

Hi Jerry I'm not an expert but I can share this with you.
If I understand well what you are looking for, try this:

a) In the World menu select 'object' and game category and pick up
'Tetris'
Now you have a morph witch is'nt an Etoy one.
b) Press Command key (on Mac) and click on the 'pause' button repeatedly
until you saw 'button' as the name of the halos...this is 4 clics.
c) Now with the 'debug' circle of the halo choose 'explore morph'. This
will bring a kind of inspector which give you the structure
(construction) of the main morph.
In that inspector you'll see the actionSelector: '#pause' this message
is sent to the target: 'a TetrisBoard'
d) To know the implementation of the method 'pause' do this:
    Type 'TetrisBoard' in the bottom pane of the inspector, select it
and do Command b keys. This will bring a Hierarchy Browser one the
TetrisBoard Class. Once there, look for 'pause' on the right panel,
select it and you'll see the code in the bottom panel.
===================
An other way to do the same thing is:
do the same a) b) and c) points....now you are in the explorer (the structure's inspector) and you know that the method (function) you are looking for is 'pause', so you can type pause in the bottom panel (or in an workspace) select it and press Command Shift w. This will bring a Messages Browser.

Look for 'pause' in the left pane, select it and you'll see in the right pane the classes who implement such a message, as you know that the target of that message was TetrisBoard you just select it and you see the code in the bottom pane.

> Another thing I haven't been able to figure out:  How do I access or
> reference a morph that I have created via direct manipulation?  I know I
> can get an inspector on it and call it "self" in the inspector's code pane
> ((language, language, hope I'm expressing things correctly)), but how can I
> actually write code that gets or sets something on that morph out of that
> special context?
> 
> 			- Jerry

I don't know all the picture here, but I know you can pick a Workspace and in his window menu select 'create textual references to dropped morphs' and, drop your morph on the Workspace, you'll have a reference for this morph.
> -------------------------
> Dr. Gerald J. Balzano
> Teacher Education Program
> Dept of Music
> Laboratory for Comparative Human Cognition
> Cognitive Science Program
> UC San Diego
> La Jolla, CA 92093
> (619) 822-0092
> gjbalzano at ucsd.edu

Hope this help

Raymond




More information about the Squeak-dev mailing list