home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.next.programmer
- Path: sparky!uunet!nic.unh.edu!strangeways.unh.edu!tjb
- From: tjb@strangeways.unh.edu (Thomas J. Baker)
- Subject: Indentifying menu Items from a target object
- Message-ID: <1992Jul31.170612.5317@strangeways.unh.edu>
- Sender: tjb@strangeways.unh.edu (Thomas J. Baker)
- Reply-To: tjb@strangeways.unh.edu (Thomas J. Baker)
- Organization: Baker Consulting - Dover, NH
- Date: Fri, 31 Jul 1992 17:06:12 GMT
- Lines: 40
-
-
- I'm building a submenu on the fly that will contain the names of the
- current uucp-connected systems: Here is the code:
-
-
- systemMenu = [[Menu alloc] init];
- subCell = [mainMenu findCellWithTag:28];
- [mainMenu setSubmenu:systemMenu forItem:subCell];
-
- pp = popen("/usr/bin/uuname","r");
-
- while(fgets(instr,sizeof(instr),pp) != NULL) {
- instr[strlen(instr) - 1] = '\0';
- strcat(instr,"...");
- newCell = [systemMenu addItem:instr action:@selector(newMonitor:)
- keyEquivalent:0];
- [newCell setTarget:self];
- }
-
- pclose(pp);
-
-
-
- The newMonitor is defined as - newMonitor:sender. The menu builds
- beautifully but when testing and choosing one of my new menu items,
- instead of getting the id of the menuCell in newMonitor, I get the id of
- the Matrix of menuCells.
-
- How can I set this up so that I can identify which cell sent the message?
- Is this the best way to approach the problem?
-
- Thanks,
-
- tjb
- --
- +-------------------------------------------------------------------+
- | Thomas Baker Director of the New Hampshire NeXT User Group |
- | P.O. Box 213 Internet/NeXTmail: tjb@strangeways.unh.edu |
- | Durham, NH 03824 Voice: (603) 743-4987 |
- +-------------------------------------------------------------------+
-