MATLAB: Is the uicontextmenu not responsive on some of the entries in a listbox in MATLAB 7.0.4 (R14SP2)

listboxMATLABuicontextmenuuicontrol

1. I created a listbox style uicontrol object that has many entries.
2.Then I associated a uicontextmenu with the listbox. The uicontextmenu is available by right-clicking on the first few listbox items.
3. However, I am unable to obtain the uicontextmenu by right-clicking on listbox items that are not initially displayed in the figure. This is illustrated by executing the following commands:
d=uimenu;
c = uicontextmenu;
set(d,'Parent',c)
p=uicontrol('style','listbox','position',[0 0 100 40],'string','one|two|three|four|five|six')
set(p,'uicontextmenu',c)

Best Answer

This issue has been fixed in MATLAB 7.1 (R14SP3). If you are using a previous version, read the following:
This issue only occurs in MATLAB 7.0.4 (R14SP2). To workaround this issue, make the listbox uicontrol object larger by changing the 'Position' parameter. Listbox items that appear in the uicontrol object before scrolling have a functional uicontextmenu.