Newsgroups: comp.sys.mac.programmer Path: utzoo!utgpu!jarvis.csri.toronto.edu!ephemeral.ai.toronto.edu!dudek From: dudek@ai.toronto.edu (Gregory Dudek) Subject: Append menu is slow. Message-ID: <89May9.171757edt.11077@ephemeral.ai.toronto.edu> Summary: AppendMenu must do serial searches, is there a faster way? Keywords: AppendMenu menu slow efficiency Organization: Department of Computer Science, University of Toronto Date: Tue, 9 May 89 17:17:45 EDT The application I am writing needs to create some large menus; up to 128 items (sometimes more). I know, that's uuuugly but I want to allow selection from a long list of undifferentiated items. I am using AppendMenu to make some big menus and it is slowwwwww (i.e. on the order of 5 seconds on a Mac Plus). Worse yet, I have to create new menus like this dynamically & the delays are unbearable. If anybody has any suggestions on how to speed things up, they'd be most welcome. I am pretty sure AppendMenu must re-scan the menu serially each time a new item is inserted. With this in mind, I tried using InsertItem but it's just as slow. While we're at it, inserting several items at a time using the semicolon as a separator doesn't help either. (Yes, I can use a scrolling list instead of a huge menu, but I am not at all sure that's any more convenient. Such a list is essentially the same as a menu & have a lot of them floating around the screen could be a real pain.) Gregory Dudek -- Dept. of Computer Science (vision group) University of Toronto Nice mailers: dudek@ai.utoronto.ca UUCP: {uunet,decvax,linus,pyramid, dalcs,watmath,garfield,ubc-vision,calgary}!utai!dudek ARPA: user%ai.toronto.edu@relay.cs.net