Dynamically creating Pop-up menus

3 Ansichten (letzte 30 Tage)
Luffy
Luffy am 4 Jul. 2012
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 Kommentare
Jan
Jan am 4 Jul. 2012
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 am 4 Jul. 2012
Thank you fr the answer,from now on i will spend more time in posting details

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Jan
Jan am 4 Jul. 2012
Bearbeitet: Jan am 4 Jul. 2012
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 Kommentar
Luffy
Luffy am 4 Jul. 2012
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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by