Adding Gadget and menu in this source code

Online Status

I added a menu entry and a new gadget using this source code. Now, when I cycle the items I the menu change accordingly but when I select the item on the menu it is not changed in the cycle gadget.
Any idea why?
https://www.edsa.uk/blog/tutorial-a-simple-amigaos-gui-in-assembler

Online Status

Well, maybe you made some mistake incorporating the code? Hard to know without actually seeing the source code for the program that has the problem :-/ Did you try showing your code to the author of that article? It's fairly recent so he will probably be responsive to questions about it.

Online Status

I can see two things from a quick glance:

1) Don't use OldOpenLibrary(). It will not save you anything since it will just load #0 in D0 and then go through the usual OpenLibrary() function. Since you are using v36 routines you should be using OpenLibrary("libname", 36). This is obviously not the issue though.

2) It looks like you are treating a code of $0 to mean no menu is selected. This is incorrect and might be causing your problem. If no menu item was selected, you should get MENUNULL which is defined as $FFFF.

Online Status

I will see later for now I get rid of the menus.