Dynamically creating Pop-up menus

조회 수: 3 (최근 30일)
Luffy
Luffy 2012년 7월 4일
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