swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Processing TK events


From: Benedikt Stefansson
Subject: Re: Processing TK events
Date: Thu, 12 Jun 1997 20:51:32 +0200

Kevin Crowston wrote:

[Snip]
> I thought I could fix this by putting some call
> inside the loop to process UI events more frequently, but I'm not sure
> what the call should be.  [controlPanel doTkEvents] seems to be
> more-or-less what I want, but since the agent isn't a GUISwarm that
> doesn't work.
[Snip]

Since controlPanel is presumably an instance variable of the
ObserverSwarm, have you thought about passing the agent a pointer
to the panel and then execute the doTkEvents? Alternatively you
could pass a pointer to ObserverSwarm to the agent and then put
this method in ObserverSwarm:

-updateGUI {
        [controlPanel doTkEvents];
        return self;
}

and then in the agent you simply say:

        [observerSwarm updateGUI];

where observerSwarm is the name of the instance variable that
points to ObserverSwarm.

I have taken to passing the pointer to ObserverSwarm to ModelSwarm
when I call buildObjects (assuming that you have main.m create
ObserverSwarm, and ObserverSwarm create ModelSwarm) i.e. instead of

        [modelSwarm buildObjects]

ObserverSwarm calls:

        [modelSwarm buildObjects: self]

and now you can have modelSwarm pass the pointer to ObserverSwarm
to any object in the model that needs this info. (Of course you have
to define the buildObjects: method in ModelSwarm.)


Regards,
-Benedikt

-- 
------------------
Benedikt Stefansson               address@hidden

Center for Computable Economics   Tel. (310) 825-1777
Department of Economics, UCLA     Fax. (310) 825-9528
Los Angeles, CA 90095-1477        http://cce.sscnet.ucla.edu

Laboratorio di Economia           Tel. (0461) 882246
Dip. di Economia, U. di Trento    Fax. (0461) 882222
38100, Trento, Italy              http://www-ceel.gelso.unitn.it

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]