[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
return type for a method parameter & assigning probe buttons
From: |
William S. Shu |
Subject: |
return type for a method parameter & assigning probe buttons |
Date: |
Tue, 07 Sep 1999 19:39:43 +0100 |
Please help me on the following. They are probably naive, but they niggle
and my search not successful!
Problem 1: Objective-C) How can one pass a method as an argument as well
as the type of its return value? I can do that for functions, but it is
not convenient. The code where I have the the problem is:
// return value of neighbourhood (defined by bL and tR). It is the sum ...
// valueOf takes *no* argument
- (Real)getValueBL: (Point)bL TR: (Point)tR
class: (id)aClass order: (int)type value: (SEL)valueOf {
id obj;
int i, j;
Real val;
...
obj = [self getWorldObjectAtX: i Y: j];
if ([obj isKindOf: aClass]) {
....
val += [obj valueOf] <====== **** return type assumed to be id
***
}
....
return val;
}
Problem 2:) I want to probe a Person object and a Mosquito object by
clicking the right mouse button. Unfortunately, it seems only the last
executed setButton:Client:Message: command is obeyed. My question is/are:
How do I get to probe both objects (in fact any object) on the raster
by using the same mouse button.
Assuming I succeed to enable the mouse clicks, how do I selectively
disable them?
The code is:
// Also, tell the world raster to send mouse clicks to the
// personDisplay and the MosquitoDisplay. This allows the user to
right-click on
// the display to probe the person and mosquito objbects.
// for Person
[worldRaster setButton: ButtonRight // use Right button
Client: personDisplay
Message: M(makeProbeAtX:Y:)];
//for Mosquito
[worldRaster setButton: ButtonMiddle // use Middle button
Client: mosquitoDisplay
Message: M(makeProbeAtX:Y:)];
Thanks,
William
==================================
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.
- Re: 2nd Problem Installing Swarm2.0 in LinuxPPC R5, (continued)
- Re: 2nd Problem Installing Swarm2.0 in LinuxPPC R5, Marcus G. Daniels, 1999/09/05
- 3rd Problem Installing Swarm2.0 in LinuxPPC R5, Darren Schreiber, 1999/09/05
- Re: 3rd Problem Installing Swarm2.0 in LinuxPPC R5, Marcus G. Daniels, 1999/09/05
- 4th Problem Installing Swarm2.0 in LinuxPPC R5, Darren Schreiber, 1999/09/06
- Re: 4th Problem Installing Swarm2.0 in LinuxPPC R5, Marcus G. Daniels, 1999/09/06
- Re: 4th Problem Installing Swarm2.0 in LinuxPPC R5, Darren Schreiber, 1999/09/07
- Using forEach:, Darren Schreiber, 1999/09/07
- Re: Using forEach:, Norberto Eiji Nawa(0.3.31), 1999/09/07
- Re: Using forEach:, Ken Cline, 1999/09/07
- Re: 4th Problem Installing Swarm2.0 in LinuxPPC R5, Marcus G. Daniels, 1999/09/07
- return type for a method parameter & assigning probe buttons,
William S. Shu <=
- Re: return type for a method parameter & assigning probe buttons, Marcus G. Daniels, 1999/09/07
- Re: return type for a method parameter & assigning probe buttons, William S. Shu, 1999/09/07
- [no subject], DARREN MATTHEW SCHREIBER, 1999/09/07
- Re: none, Marcus G. Daniels, 1999/09/07
- Dendogram, Darren Schreiber, 1999/09/08
- Re: Dendogram, Marcus G. Daniels, 1999/09/08
- Display direction, Jayshree Sarma, 1999/09/08
- Re: Display direction, Marcus G. Daniels, 1999/09/08
- Error Message - Swarm-1.4.1, Jayshree Sarma, 1999/09/09
- Re: Error Message - Swarm-1.4.1, Marcus G. Daniels, 1999/09/09