Thread View: comp.sys.next.programmer
3 messages
3 total messages
Started by Thomas J. Baker
Fri, 31 Jul 1992 17:06
Indentifying menu Items from a target object
Author: Thomas J. Baker
Date: Fri, 31 Jul 1992 17:06
Date: Fri, 31 Jul 1992 17:06
40 lines
1754 bytes
1754 bytes
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 |
+-------------------------------------------------------------------+
Re: Indentifying menu Items from a target object
Author: Thomas J. Baker
Date: Fri, 31 Jul 1992 18:56
Date: Fri, 31 Jul 1992 18:56
31 lines
1743 bytes
1743 bytes
In article <1992Jul31.170612.5317@strangeways.unh.edu> tjb@strangeways.unh.edu (Thomas J. Baker) writes: > > I'm building a submenu on the fly that will contain the names of the > current uucp-connected systems: Here is the code: > 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. > > <code deleted> > > 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? > Following up my own post, Paul Kim (pkim@delft.berkeley.edu) gave me the answer I needed. In newMonitor, I just needed to call [sender selectedCell] to get the id of the chosen cell. 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 | +-------------------------------------------------------------------+
Re: Indentifying menu Items from a target object
Author: Eric P. Scott
Date: Sat, 01 Aug 1992 02:03
Date: Sat, 01 Aug 1992 02:03
11 lines
841 bytes
841 bytes
In article <1992Jul31.170612.5317@strangeways.unh.edu> tjb@strangeways.unh.edu (Thomas J. Baker) writes: >I'm building a submenu on the fly that will contain the names of the >current uucp-connected systems NeXT's User Interface Guidelines people STRONGLY DISCOURAGE this. [Think about what happens when you have a large number of items.] -=EPS=- -- I don't make the news, I just report it.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads