Why can I acess the menu editor from GUIDE to do changes?

3 ビュー (過去 30 日間)
Daniel Fonsêca
Daniel Fonsêca 2019 年 1 月 10 日
コメント済み: Daniel Fonsêca 2019 年 1 月 11 日
Good day. I'm making a app using the GUIDE. That app has menu, and I want my final user can add more menu items.
In a normal program, we use, for example:
f = figure('ToolBar','none');
m = uimenu(f,'Text','Import');
mitem = uimenu(m,'Text','CSV File');
to do a menu and a menu item.
A don't know how to get this variable f which carry the informations about the figure.

採用された回答

Walter Roberson
Walter Roberson 2019 年 1 月 10 日
If you are only using a single figure, then in GUIDE you could do
f = gcf;
because GUIDE apps are figures.
If you are using multiple figures within GUIDE, then you need to be a careful, because GUIDE always constructs the handles structure that it passes around with respect to the figure that the callback is attached to. There is no real way in GUIDE to ask about the "master" figure. However, once you are passed the OpenFcn callback of the original figure, then if you call the main GUI by name with no arguments then the return value will be the handle of that figure.
  4 件のコメント
Walter Roberson
Walter Roberson 2019 年 1 月 11 日
If you need to get to the menu item later, then you could
handles.mitem = mitem;
and then later refer to handles.mitem .
Or instead, later you could
mitem = findobj(handles.output, 'tag', 'h');
Daniel Fonsêca
Daniel Fonsêca 2019 年 1 月 11 日
Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by