Assistance with modifying Morphic and Squeak

squeak-dev at lists.squeakfoundation.org squeak-dev at lists.squeakfoundation.org
Thu Sep 19 09:14:32 UTC 2002


Hi Albert and all!

( I took the liberty of CCing this answer to the list )

"Albert" <alsoc at earthlink.net> wrote:
> Hi I am an undergraduate doing an independent study with squeak, I was
> wondering if you could help me out with a few pointers for my first
> squeak programming assignment, -Adding a handle to the halo of all

Just so you know - there have been questions about how to solve
assignments given in school on this list before. Depending on the
questions, the general answer is that one of the points behind
assignments is that you should try to solve them yourself. That is
probably one reason why your question on the list has gone unanswered
sofar.

Now having said that I can still give you a lead to where to start. Note
though that I am not a morphic expert like Ned or Bob :-) - I just did
some digging for 5 minutes to deliver this to you. :-)

> morphs-. I know morphic from a user standpoint and have done a lot
> smalltalk code. I have browsed event classes and fundamental morph
> classes. I have even browsed methods such as addHandle. . However, due
> to lack of sophistication with squeak I am still unable to find where it
> is that a handle is actually added or drawn as well as were to put the
> event handling code for the "handle" that I hope to add. Before I embark
> on asking detailed questions, I would like to ask you for any general

Just a hint - if you really want further answers you will need to show
that you are doing your part on the other end. Ok? We don't want to
annoy any teachers out there - hey, he or she might even be on this
list!:-)

> advice/suggestion you may have on how to approach this project. I would

Well, we all do these things differently but a few quick advice:

1. Use the method finder guessing a bit with keywords. Often a very good
start.
2. When you find some method that looks interesting, use senders of and
implementors of. Very important.
3. Use the method categories as a guide to where to look.
4. Don't forget to look through the class names - for example, HaloMorph
can easily be found by using "find class" and just yping in "halo".
5. One trick is to try to get into the debugger - a very good way to
find out what is going on. But before this - save the image! You might
get yourself into trouble. Then try adding a "self halt" in a suitable
method - say the one mentioned below and take a look at the stack to see
how Squeak got there. Dont forget to look at the objects, especially the
explorer is very useful.

> also appreciate any detailed pointers such as: "check out method z in
> class x". I would be happy to share the results with you (if interested)

Check out HaloMorph>>addHandle:on:send:to:

That is code deep down in the bowels that "build" the small little
ellipses with icons in them IIANM (If I Am Not Mistaken - is that a
common netronym?). Now - use "senders of" in multiple steps backtracking
out from there and perhaps you will then figure out a bit how this stuff
works.

As I described above, an even better way to learn is to try adding a
"self halt" at the top of this method and then bring up a halo on
something. That will let you see how it got there - very useful. (And
since I just tried it myself I can say that the 3.2 image didn't go
bananas).

> as well as future modifications or projects that I will have. I
> appreciate any assistance from you. 

Since this is an "open source" project we more or less expect you to
share!:-)
  
>             Thank You,
> 
>                         Albert Hoenigmann

No problem - good luck, regards Göran



More information about the Squeak-dev mailing list