Dynamically creating Pop-up menus

3 次查看(过去 30 天)
Is there a way thru which i can dynamically create pop-up menus,
example:- I have a graph with plots of sind(1:360),cosd(1:360) in it,
so there are 2 axis children and i want 2 poup menus,
similarly if i hv n children can i get n popupmenus,one for each child
  4 个评论
Jan
Jan 2012-7-4
Funny. Please post the relevant details: Do you want to appear the popups on a fixed position in the figure, relative to the drawn object or when you click on the drawn line (similar to a context-menu)? Should it be the same figure as the diagrams or a separate figure?
The more time you spend in posting the required details, the less time is necessary for the answerers to guess what you could want.
Luffy
Luffy 2012-7-4
Thank you fr the answer,from now on i will spend more time in posting details

请先登录,再进行评论。

采纳的回答

Jan
Jan 2012-7-4
编辑:Jan 2012-7-4
Use uicontrol to create a popup menu dynamically:
figure;
for i = 1:10 % [EDITED, loop added]
uicontrol('Style', 'popupmenu', ...
'String', {'Item 1', 'Item2', 'Item 3'}, ...
'Units', 'pixels', ...
'Position', [10, i*30, 120, 24]);
end
  1 个评论
Luffy
Luffy 2012-7-4
I do not want to create strings in pop-up menu dynamically,i want to create pop-up menu itself dynamically.
In the example i gave in question(sind(1:360)&cosd(1:360)),i want two popupmenus with strings in them being static('r','g','b'...).
If i have another graph with 3 plots in it i want 3 popupmenus with strings in it same(rgb-colors).
I hope you understand,if i have graph with 10 plots in it,i want 10 popup menus with each popup menu to change color of each axeschildren

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by