Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!jpd00964 From: jpd00964@uxa.cso.uiuc.edu Newsgroups: comp.sys.next Subject: Re: mutiTargets Message-ID: <246300049@uxa.cso.uiuc.edu> Date: 25 Aug 89 10:31:00 GMT References: <133000008@silver> Lines: 45 Nf-ID: #R:silver:133000008:uxa.cso.uiuc.edu:246300049:000:1471 Nf-From: uxa.cso.uiuc.edu!jpd00964 Aug 25 05:31:00 1989 /* 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