Creating Graphical User Interfaces |
Panels
Panels group GUI components and can make a user interface easier to understand by visually grouping related controls. Panel children can be panels and button groups as well as axes and user interface controls. The position of each component within a panel is interpreted relative to the panel. If the panel is resized, you may want to reposition its components.
The following callback executes and gets the Position
property of uipanel2
whenever the panel is resized. Once you have the size data contained in the Position
property, you can modify the Position
properties of the child components to reposition them. Use the Children
property of uipanel2
to get the handles of its child components.
function uipanel2_ResizeFcn(hObject, eventdata, handles)
% hObject handle to uipanel1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
pos = get(hObject,'Position');
% proceed with callback...
Pop-Up Menus | Button Groups |
© 1994-2005 The MathWorks, Inc.