Article # 342, added by Geoworks, historical record
| first | previous | index | next | last |

Adding items to a menu that don't show up.



Q. I added a couple of entries to a menu and now the contents of the
   menu don't appear when I click on it. I looked at the source
   code, but I just can't see what's wrong.

A. Sometimes when you add items to a menu (or any other object tree)
   you forget to change all the links. Here's a rough example:

     @object class object1 = {
         GI_comp = @object2,
                   @object3;
     }

     @object class object2 = {
     }

     @object class object3 = {
     }

   Now say I want to add an object4 and group it with object3:
     @object class object1 = {
         GI_comp = @object2,
                   @object3;
     }

     @object class object2 = {
     }

     @object class objectgroup = {
         GI_comp = @object3,
                   @object4;
     }

     @object class object3 = {
     }

     @object class object4 = {
     }

   Now I'm sure you can see something was forgotten, as this is a
   simple example. I forgot to change the GI_comp field in object1,
   so it's pointing to the wrong object. It should be like this:

     @object class object1 = {
         GI_comp = @object2,
                   @objectgroup;
     }

   In a more complex object tree, spotting this error is difficult.