Version (2.76 KB) by Igor
Allows to trigger figure's "Always On Top" state in Matlab
Updated 27 Oct 2019

WINONTOP allows to trigger figure's "Always On Top" state


# figureHandle - Matlab's figure handle, scalar
# isOnTop - logical scalar or empty array


* WinOnTop( hfigure, true ); - switch on "always on top"
* WinOnTop( hfigure, false ); - switch off "always on top"
* WinOnTop( hfigure ); - equal to WinOnTop( hfigure,true);
* WinOnTop(); - equal to WinOnTop( gcf, true);
* WasOnTop = WinOnTop(...); - returns boolean value "if figure WAS on top"
* isOnTop = WinOnTop(hfigure,[]) - get "if figure is on top" property

For Matlab windows, created via `hf=uifigure()` use `uifigureOnTop()`, see:


* java enabled
* figure must be visible
* figure's "WindowStyle" should be "normal"
* figureHandle should not be casted to double, if using HG2 (R2014b+)

Cite As

Igor (2024). WinOnTop (, GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Graphics Objects 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!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

link for uifigureOnTop

connected to github; renamed "test_" to "demo_"

fixed IsOnTop vs isOnTop bug

Another "is using Handle Graphics v2" check mechanism,
Trying to fix zip file getting damaged by Mathworks site.
fixed duplicate license.txt files

adapted for changes in matlab graphics system (since R2014b)

couple of critical fixes

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.