Perform dynamic update of Hotlist menu when using MenuClass menus

Currently updates on closing the Hotlist window, but could be persuaded to update on every hotlist drag if deemed necessary.
This commit is contained in:
Chris Young 2017-01-16 22:24:05 +00:00
parent 53ce28c170
commit 2083375ec4
2 changed files with 3 additions and 2 deletions

View File

@ -3327,7 +3327,7 @@ void ami_gui_hotlist_update_all(void)
if(IsMinListEmpty(window_list)) return;
//ami_gui_menu_refresh_hotlist(); /**\todo disabled as menuclass isn't updating correctly */
ami_gui_menu_refresh_hotlist();
node = (struct nsObject *)GetHead((struct List *)window_list);

View File

@ -240,6 +240,7 @@ static int ami_menu_layout_mc_recursive(Object *menu_parent, struct ami_menu_dat
if(level == NM_TITLE) {
menu_item = NewObject(NULL, "menuclass",
MA_Type, T_MENU,
MA_ID, j,
MA_Label, md[j]->menulab,
TAG_DONE);
} else {
@ -446,7 +447,7 @@ void ami_menu_refresh(struct Menu *menu, struct ami_menu_data **md, int menu_ite
if(LIB_IS_AT_LEAST((struct Library *)IntuitionBase, 54, 6)) {
/* find the address of the menu */
menu_item_obj = (Object *)IDoMethod((Object *)menu, MM_FINDID, 0, menu_item);
printf("%lx\n", menu_item_obj);
/* remove all children */
while((obj = (Object *)IDoMethod(menu_item_obj, MM_NEXTCHILD, 0, NULL)) != NULL) {
IDoMethod(menu_item_obj, OM_REMMEMBER, obj);