Re: passing messages

Edward Ballot (eballot@fusion.geoworks.com)
Sat, 6 Jul 1996 09:32:51 -0700 (PDT)

Section 5.4 of the Concepts book shows the syntax. You might also want
to look at the previous section. (In fact, you might want to at least
skim over the first 10 or so chapters in the Concepts book. It is
much easier to code for Geos once you have a basic conceptual
understanding to work from.)

Basically, you define the message in the class like this:
@class MyDoClass, GenProcessClass;
@message void MSG_DO_SOMETHING(int i, int j, char *someString);
/* more messages and instance data can go here */
@endc;
@classdecl MyDoClass;

Later you write the message handler like this:
@method MyDoClass, MSG_DO_SOMETHING /* parameters are already known */
{
/* code goes here */
}

Hope that helps,

- -Ed-

On Fri, 5 Jul 1996 tzz@acs.bu.edu wrote:

>
> I am sure this is very simply answered. I could not figure it out
> or find it in the docs on my own though.
>
> How do I declare a message which has parameters? Similar to the
> button1 down message where you get xPos and yPos, how can I
> have a message like MSG_DO_SOMETHING(5, 1, "Alpha") ?
>
> Just a pointer to the relevant section in the manuals would
> be enough.
>
> Ted
>