Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!unmvax!grumpy.cs.unm.edu!stone From: stone@grumpy.cs.unm.edu (Andrew Stone) Newsgroups: comp.sys.next Subject: Re: problem with Interface Builder Action Messasges Keywords: selectedCell, selectedRow Message-ID: <260@unmvax.unm.edu> Date: 1 Aug 89 23:33:50 GMT References: <56535@tut.cis.ohio-state.edu> Sender: news@unmvax.unm.edu Reply-To: stone@hydra.unm.edu () Distribution: na Organization: University of New Mexico at Albuquerque Lines: 26 In article <56535@tut.cis.ohio-state.edu> mark@apple3.cis.ohio-state.edu (Mark Jansen) writes: >I am trying to use interface builder for a medium size programming project >and am having trouble with action messages and tags. I have create a couple of >control panels with buttons and text fields enclosed within matracies and >boxes. I have connected the button and text field action messages to target >my application object and that all works fine. > >I then query the sender of the message for its tag and am getting the >wrong tag number. Apparently the tag is from the matrix or box that contains >the button pressed. How do I get around this difficulty? When a you have a matrix of buttons [or menuCells for that matter], the sender is the matrix itself, not the individual button. To get its tag, you could : myTag = [[sender selectedCell] tag]; Or you could look at its position, and base your logic on #defines, remembering that 0 is the first position, then: int row = [sender selectedRow]; // columnar list switch (row) { .... One day I woke up and it all made perfect sense. andrew