Dynamically creating Pop-up menus

3 vues (au cours des 30 derniers jours)
Luffy
Luffy le 4 Juil 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 commentaires
Jan
Jan le 4 Juil 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 le 4 Juil 2012
Thank you fr the answer,from now on i will spend more time in posting details

Connectez-vous pour commenter.

Réponse acceptée

Jan
Jan le 4 Juil 2012
Modifié(e) : Jan le 4 Juil 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 commentaire
Luffy
Luffy le 4 Juil 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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by