Dynamically creating Pop-up menus

3 visualizaciones (últimos 30 días)
Luffy
Luffy el 4 de Jul. de 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 comentarios
Jan
Jan el 4 de Jul. de 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 el 4 de Jul. de 2012
Thank you fr the answer,from now on i will spend more time in posting details

Iniciar sesión para comentar.

Respuesta aceptada

Jan
Jan el 4 de Jul. de 2012
Editada: Jan el 4 de Jul. de 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 comentario
Luffy
Luffy el 4 de Jul. de 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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by