Stuart’s MATLAB Videos

Watch and Learn

uicontextmenu and ButtonDownFcn in MATLAB

When you use ButtonDownFcn in MATLAB, your callback is given an automatic input called hObject. This hObject is the handle of the object that you interacted with to invoke the callback, which makes it easy to define behavior based on the selected object. This is a little trickier when working with uicontextmenu, since the context menu itself is reported as the selected object. This video explains the behavior and shows one way to get the handle to the actual object the user selected. This is an advanced topic that assumes you know about callbacks and UiContextMenu.
|
  • print

评论

要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。