Saturday, February 24th 2018, 7:04pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.



Date of registration: Apr 4th 2013

Posts: 3


Thursday, June 6th 2013, 6:18pm

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?

Date of registration: May 26th 2009

Posts: 1,022


Monday, June 10th 2013, 10:54am


This is actually not a bug, but we will try to improve this in a future emWin version. Thank you for the hint.

Best regards,

Similar threads