Context menu only works in the border around my uitable...
이전 댓글 표시
Using GUIDE I built a GUI containing a uitable, and I associated a context menu with the uitable. When I run the GUI, the context menu only appears when I right click in a very narrow perimeter around the table, not when I right click in the area comprising the rows/cells of the table. I do not have a ButtonDownFcn set for the uitable, and I have tried (perhaps erroneously) to rectify the observed problem by setting HitTest for the uitable to 'off'. Didn't work. My goal is to be able to use the left mouse button for selecting a cell (I know how to do this from previous work) and the right mouse button for calling the context menu to operate on the cell, but this is impractical if the context menu only works in a thin strip outside the uitable. Bear in mind here that I don't need to know how to get cell-specific data from a right-click; I just want the context menu to work within the space of the table. What am I missing?
Rapid Summary: The context menu associated with my uitable doesn't work within the table, only in a small perimeter around it. How can I make it work inside the table too?
Thanks to everyone who gives this a look.
David
채택된 답변
추가 답변 (1개)
Oleg Komarov
2011년 4월 15일
uh = uicontextmenu;
uimenu(uh,'label','blabla')
t = uitable('Data',magic(10),'uicontextmenu',uh)
카테고리
도움말 센터 및 File Exchange에서 App Building에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!