GUI Layout Toolbox

Layout management objects for MATLAB GUIs
Updated 1 Sep 2016

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

NB: This version is for MATLAB release R2014a and earlier. If you are using MATLAB R2014b or later please use the new version here:
This toolbox provides tools to create sophisticated MATLAB graphical user interfaces that resize gracefully. The classes supplied can be used in combination to produce virtually any user interface layout.
* Arrange MATLAB user-interface components horizontally, vertically or in grids
* Ability to mix fixed size and variable size elements
* Dynamic resizing of elements by dragging dividers
* Use panels and tabs for switching interface pages
Documentation is included and is integrated into the MATLAB Help Browser. It can also be viewed as a stand-alone web-page.

These layouts are designed to be extensible. A good example of how to do this is Matt Whitaker's ButtonGroups:

This toolbox was developed by Ben Tordoff and David Sampson from the Consulting group at MathWorks.

Cite As

Ben Tordoff (2024). GUI Layout Toolbox (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on App Building in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Updated license

Add link to R2014b version

* Allow vresion to be checked using ver('layout')
* Misc doc fixes (including spelling of hierarchy!)
* Fix some edge-case bahaviours for TabPanel

Fix support for appdata.

* Improve colorbar handling (ignoring)
* Fix bug in reparenting children
* Fix background color of BoxPanel icons

* Fix error when axes deleted using R2013a
* Fix handling of legends (which I broke in the last update)

* Fix a bug when deleting axes using R2013a
* Fix a bug in how legends are handled

* Fix (I hope) bug where axes disappear from tabs
* Fix bug where axes position is corrupted if tabs become too small to draw

Remove documentation link from description since the new File Exchange page does not allow this.

* Add TabEnable property for controlling the enabled state of individual tabs
* Revert to normalized units for all layouts
* Fix bug with mouse-over events

Update description to include a link to Matthew Whitaker's ButtonGroup objects.

* Add MinimumSize properties to Boxes and Grids
* Minor improvements to mouse-over and redraw speed
* Fix bug with ordering of controls that sometimes prevented grid dividers being dragged

* Add PreviousChild event-data to uiextras.TabPanel Callback
* Add guards to prevent errors when focus is lost whilst dragging a flexible divider
* Fix bug when trying to print figures containing flexible layouts

* Improve enable behavior when used with custom widgets
* Add an explanation of cell arrays used to pass extra function arguments
* Fix bug in unit-setting of children added to layouts (improves axes handling)

* Make panel "SelectedChild" property observable for use with event.proplistener
* Fix bug with dividers disappearing when GridFlex's are nested
* Fix clipping bug with Tab label text drawing outside parent container

Fix link in description (hopefully - it's a bit of a moving target)

* Add DeleteFcn property
* Improve Docking and Minimizing examples
* Fix flexible layouts when figure units are not pixels (e.g. in GUIDE apps)
* Documentation on using layouts in a GUIDE-built GUI
* Fix parenting bug with ButtonBoxes

* Add ability to set defaults for various properties
* Remove R2010a specific code to allow use on older releases

* Fix bug with Panel titles
* Fix bug with EmptyWidget going out of scope
* Prevent legends being hijacked by the layout managers!
* Add option for showing markings on the movable dividers
* Add documentation on building executables

* Ensure layout objects are deleted when the graphics are deleted
* Add "ancestor" method
* Fix bug in GridFlex divider positioning
* Remove ">>" from examples in documentation
* Improve formatting of examples in documentation

Added missing "root" and "version" functions

Add link to documentation from description

Further documentation typo fixes (must use spellchecker more...)

Fixed some typos in the documentation