GUI - Align "Distribute" option does not work
Afficher commentaires plus anciens
Dear community,
I'm creating a basic GUI where I have inserted a panel and two push buttons.
I would like to uniformly distribute the two pushbuttons inside the panel on the vertical dimension, but the align "distribute" option doesn't work. In fact, the GUI shows the buttons one superimposed to the other (I only see the 2nd button, the 1st is hidden under the 2nd).
Here is the code:
function Global_configuration = UI_Configuration( Global_configuration )
main_UI = figure('Visible','on','Name','UI Configuration', ...
'NumberTitle','off', 'MenuBar','none', ...
'Position',[500 300 600 600]);
main_panel = uipanel(main_UI,'Title','Configure analysis', ...
'Position',[.05 .25 .90 .70]);
b_Configure_simulation = uicontrol(main_panel,'Style','pushbutton', ...
'String','Configure Simulation', ...
'Units','normalized', ...
'Position',[.1 .3 .8 .2], ...
'Callback',{@Configure_Sim, main_UI});
b_Configure_output = uicontrol(main_panel,'Style','pushbutton', ...
'String','Configure Output', ...
'Units','normalized', ...
'Position',[.1 .3 .8 .2], ...
'Callback',{@Configure_Out, main_UI});
align([b_Configure_simulation b_Configure_output],'Center','Distribute');
end
What am I doing wrong?
Thank you in advance.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Exploration and Visualization dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!