creating uicontrol in gui without using guide
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I made a gui using guide. But in my .m gui I need to create a uicontrol but not using guide. The problem I have is that when I create a uicontrol('Style','Edit','Position',[Posx,Posy,w,l]) it plots the uicontrol well, but when I change the position the previous uicontrol is still seen, therefore I have two uicontrols, it seems it does not update the uicontrol and just creates new ones everytime I press a callback button to update the position. If I use the uicontrol in guide it does not show this problem, but I dont want to create it from guide, I will like the user to create a uicontrol if he needs too.
Regards Diego
1 comentario
Respuestas (1)
Jan
el 4 de Feb. de 2011
You can move the UICONTROL:
Pos = [0.0, 0.0, 0.1, 0.04];
EditH = uicontrol('Style', 'edit', ...
'Units', 'normalized', ...
'Position', Pos);
for i = 1:100
Pos(1:2) = [rand * 0.9, rand * 0.96];
set(EditH, 'Position', Pos);
drawnow;
pause(0.5);
end
If your program creates new UICONTROLs, when a callback runs, it (sorry) creates new UICONTROLs instead of moving the existing one. Please inspect (or post here) the code used for the intentional moving.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!