ftp.nice.ch/peanuts/GeneralData/Usenet/news/1989/CSN-89.tar.gz#/comp-sys-next/1989/Aug/mutiTargets

This is mutiTargets in view mode; [Up]


Date: Sun 23-Aug-1989 17:17:00 From: Unknown Subject: mutiTargets Hello there! I am having difficulties figuring out how to let an object send ddifferent messages to other objects at the same time. What I want is something like a popUpList so that when the mouse goes down, the button send a message pop: to the popUpList and when the mouse goes up, the popUpList send a setTitle: to the button and at the same time notify another object that the button has changed its title. What I can think of is that I can rewrite setTitle: so that it also notifies the object I want to notify. I think it should work though I have not tried it yet. I feel there should be better way to set mutiple targets for an object. Please let me know if you have better ideas. Thanks in advance. --yufeng tsui@silver.bacs.indiana.edu >From: tsui@silver.bacs.indiana.edu (Yufeng Tsui)
Date: Sun 25-Aug-1989 10:31:00 From: Unknown Subject: Re: mutiTargets /* Written 12:17 pm Aug 23, 1989 by tsui@silver.bacs.indiana.edu in uxa.cso.uiuc.edu:comp.sys.next */ /* ---------- "mutiTargets" ---------- */ >I am having difficulties figuring out how to let an object send ddifferent >messages to other objects at the same time. What I want is something like a >popUpList so that when the mouse goes down, the button send a message pop: to >the popUpList and when the mouse goes up, the popUpList send a setTitle: to the >button and at the same time notify another object that the button has changed >its title. What I can think of is that I can rewrite setTitle: so that it >also notifies the object I want to notify. I think it should work though I have >not tried it yet. I feel there should be better way to set mutiple targets for >an object. Please let me know if you have better ideas. Easy. First, have action and target fields for all of you want to do. id target1,target2,target3; char action1[255],action2[255],action3[255]; // used char a[255] instead of SEL a because we need to allocate the memory then have methods to set these - setTarget1:anObject { target1 = anObject; return self; } etc - setAction1:(SEL)action { strncpy(trncpyctaction1, return self; } etc. Then in your method that sends everything, just call it for all you want sequentially; [target1 @selector(action1)]; [target2 @selector(action2)]; [target3 @selector(action3)]; This should be easily implemented. Michael Rutman Softmed >From: jpd00964@uxa.cso.uiuc.edu

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.