Menu refresh too slow

This forum is for general developer support questions.
Post Reply
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Menu refresh too slow

Post by mritter0 »

Using the new Intuition menus. When I do a loop to remove 15+ items (not all in same NM_Menu), then add back 15+ new ones (not all in same NM_Menu), the menu strip isn't always filled in (at least visually) all the way (some items missing). If I put a Delay(TICKS_PER_SECOND/4) between removal and addition it fills in properly. It works fine with a few items removed/added.

Just an FYI.
Workbench Explorer - A better way to browse drawers
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: Menu refresh too slow

Post by thomasrapp »

You probably have to call ClearMenuStrip before you change something and SetMenuStrip afterwards. I suppose that rules have not changed for the new menu system.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: Menu refresh too slow

Post by broadblues »

@Thomas

I'm not 100% sure I but think that menuclass should handle that for you. It certainly does handle it for hiding and displaying items already on the list.

@Mritter

Did you use SetAttr and the MA_Remove MA_Add tag or the methods OM_ADDMEMBER and OM_REMOVE ? Although it says they are 100% equivalent, my gut instinct would be to use the methods on a menu if it's attached. One reason being the return type is checkable which implies it must have waited for the action to take place.

For large modifications, it's likely more efficient to remove the menu first though, whether required for individual operations or not as a layout would hapen with each change.

If you can provide a sample of the code createing the error that would be very helpful.
Post Reply