<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=windows-1252"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Since I am not familiar with BalloonMorph, I will answer generically,
and how I would go about learning it...<br>
<br>
One way to try to understand this, insert the line "self haltOnce." in
front of "corner :=" <br>
then enable Halt Once (see [1] &amp; [2]).  The highlight and Inspect
various bits of the code and single-step through the debugger watching
how it does its stuff.<br>
<br>
The other main advantage of this as opposed to just trying to
understand the code from reading it, is that you get to see what calls
this method and in what context.  <br>
<br>
<a href="http://squeak.preeminent.org/tut2007/html/095.html">[1]
http://squeak.preeminent.org/tut2007/html/095.html</a><br>
<a
 href="http://marianopeck.wordpress.com/2012/05/19/pharo-tips-and-tricks/">[2]
http://marianopeck.wordpress.com/2012/05/19/pharo-tips-and-tricks/</a><br>
<br>
cheers -ben<br>
<br>
Werner Gaisbauer wrote:
<blockquote cite="mid:82792EB3-8163-4487-BAD5-9AEBBE16D018@gmail.com"
 type="cite">
  <pre wrap="">Hello,

I really like the BallonMorph of Squeak (aka tooltip) and would like to port it to another programming language. But I’m a newbie in Smalltalk and Squeak so I’m having a hard time understanding e.g. the getVertices method. As far as I understand this method creates the vertices of the polygon that is the speech bubble?

It would really help me if someone could post this method in e.g. Java (my goal is to port BalloonMorph to Processing - see <a class="moz-txt-link-freetext" href="http://www.processing.org/">http://www.processing.org/</a>) or give me some hints on how to read it.

Here is the method:

getVertices: bounds
        "Construct vertices for a balloon up and to left of anchor"

        | corners |
        corners := bounds corners atAll: #(1 4 3 2).
        ^ (Array
                with: corners first + (0 - bounds width // 2 @ 0)
                with: corners first + (0 - bounds width // 4 @ (bounds height // 2))) , corners

Thanks for helping,

Werner Gaisbauer
  </pre>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Beginners mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a>
<a class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/mailman/listinfo/beginners">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a>
  </pre>
</blockquote>
<br>
</body>
</html>