GUI - Align "Distribute" option does not work
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Exploration and Visualization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!