File Exchange

image thumbnail

Graphical Wrappers

version (31.7 KB) by Benoit Charles
Wrappers improve Matlab graphical components.


Updated 16 Oct 2013

View Version History

View License

Wrappers improve Matlab graphical components with two major features:
- callbacks are replaced by events.
- any property can be synchronize with another object's property.

Note: This class needs MagicListener:

Observe (and run) the class DemoWrapper to see a demonstration of wrappers.

Cite As

Benoit Charles (2021). Graphical Wrappers (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

Benoit Charles

@Kritian - A big old try-catch can do the job. An updated version is incoming.


Beautiful work. However, a couple of changes have been done to the underlying graphical components in recent versions of MATLAB. For instance CellEditFcn and CellSelectionFcn have been replaced by CellEditCallback and CellSelectionCallback, respectively, at least in 2012a.
Do you know if there is a way for the wrappers to detect the version and fork to the correct names?

Benoit Charles

@Sam - Funny bug. That's append when you load a figure whith hgload and try to construct a wrapper around it. You can see, if you are interested by the topic, more informations about the bug here:

I'll make an update quickly to fix the issue.


I get the following error. Please can you help me resolve it?


Error using FigureWrapper (line 629)
The name 'FocusGainedCallback' is not an accessible property for an instance of class

Error in JurorSurveyApp (line 4)
csg = FigureWrapper(CompareSoundsGUI()


So useful, sometimes I can't understand why matlab doesn't document it events behaviour for the graphical elements. Thanks for this good submission, it makes the work simplier x)

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!