Is this a bug in the MENU widget?

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Is this a bug in the MENU widget?

    I was having some trouble with getting a submenu of a submenu to align correctly with its parent. To aid my understanding I downloaded the source WIDGET_Menu.c and successfully compiled and ran a simulation. The submenu "Files..." was correctly aligned with the parent submenu "File".

    I then rearranged the order in which the three submenus are added to the main menu as below:


    // Add menu items to main menu
    _AddMenuItem(hMenu, hMenuEdit, "Edit", 0, 0);
    _AddMenuItem(hMenu, hMenuHelp, "Help", 0, 0);
    _AddMenuItem(hMenu, hMenuFile, "File", 0, 0);

    When I recompiled and ran the application the "Files..." submenu was now misaligned and mostly covering the parent menu. Some further investigation brings me to the conclusion that the "Files..." submenu is offset by the width of the parent menu, but does not consider the position of its parent.

    Could this be resolved?