swarm-support
[Top][All Lists]
Advanced

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

That question about EZGraph arguments (was Re: none


From: Paul E. Johnson
Subject: That question about EZGraph arguments (was Re: none
Date: Wed, 05 Jan 2000 00:05:57 -0600

"Marcus G. Daniels" wrote:
> 
> >>>>> "BSLT" == BEN SAID Lamjed thesard CNET/DTL/LAN <address@hidden> writes:
> 
> BSLT> createAverageSequence:withFeedFrom:andSelector:with as non
> BSLT> implemnted methods , which is true !.
> 
> ActiveGraph/EZGraph don't have a way to pass through arguments.
> It would be nice if someone changed ActiveGraph to use the
> FCall/FArguments features (instead of it being a kind of probe).
You are a few pages ahead of me here.  What are FCall/FArguments?  I
remember you posted an example program that used these things during the
past week or so, and I meant to bother you to find out what is the grand
scheme and how I can find out more about these things.

> 
> As is, the method you provide to the andSelector: argument somehow
> needs to use indirection to get to the other parameters.
> 
I wondered what "indirection" meant in this context.

Anyway, when Marcus reminded me that EZGraph did not allow arguments, I
remembered a "sneaky trick" that I think I learned from Benedikt S.
Until somebody does redo the EZGraph, it appears this will have to do.

When you need to pass an argument with a selector, and the Swarm object
does not accept arguments, do this.  Create a new class, and inherit
from EZGraph.  Suppose you call it NewEZGraph.  The NewEZGraph need only
declare one new method, the one that is to take the argument.  Go into
the swarm source, find the original method that you are wanting to pass
the argument to, copy it into your NewEZGraph implementation file, and
edit it so it receives an argument and does what it needs to.  I am not
sure if you need to just pass in a value or the array and something
else.  The key is that the changes you make must not damage the original
method--the return has to be the same type, and so forth.  I've done
this with Object2d class and it does work.  

You have to be careful to replace the EZGraph usages with NewEZGraph
throughout, and instead of declaring the object as id aGraphThing, you
have to declare it as NewEZGraph * aGraphThing.  

This trick does not work with things in the Collections library, there
are blockades setup in there to stop you from subclassing them. But I
don't know of any blockades in the Graph or Space libraries.

I suppose there could be hidden problems in doing this kind of thing?

-- 
Paul E. Johnson                         email: address@hidden
Dept. of Political Science              http://lark.cc.ukans.edu/~pauljohn
University of Kansas                    Office: (785) 864-9086
Lawrence, Kansas 66045                  FAX: (785) 864-5700

                  ==================================
   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]