Code covered by the BSD License  

Highlights from
WinOnTop

5.0

5.0 | 3 ratings Rate this file 37 Downloads (last 30 days) File Size: 2.05 KB File ID: #42252
image thumbnail

WinOnTop

by

 

17 Jun 2013 (Updated )

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

| Watch this File

File Information
Description

WINONTOP allows to trigger figure's "Always On Top" state
INPUT ARGUMENTS:
* FigureHandle - Matlab's figure handle, scalar
* IsOnTop - logical scalar or empty array

USAGE:
* WinOnTop( hfigure, bool );
* 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,[]) - gets "if figure is on top" property

LIMITATIONS:
* java enabled
* figure must be visible
* figure's "WindowStyle" should be "normal"

Written by Igor
i3v@mail.ru

16 June 2013 - Initial version
27 June 2013 - removed custom function call

Acknowledgements

Figure Window Always On Top, Set Figure Window To Be Always On Top., and Alwaysontop inspired this file.

Required Products MATLAB
MATLAB release MATLAB 8.1 (R2013a)
Other requirements java
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (10)
29 Jul 2014 Jerry  
03 Apr 2014 Bob

I was trying to put an overlay window on top of X-Plane with no success - until I used your code! MANY THANKS.

31 Mar 2014 Ronobir Sarker

How can I find that file?

27 Jun 2013 Igor

Thanks, Christine !

27 Jun 2013 Mark

Hi Igor,
I'm having trouble getting the code to work. Should the file be placed in the active directory? I also get an undefined function error for 'ishandle_scalar'.

Thanks,
Mark

27 Jun 2013 Christine

Hi Igor,
now it works fine. And I want to repeat the sentence I read so often here: Your program is exactly what I needed. Thanks a lot! :)

27 Jun 2013 Igor

Hi Christine,
thanks for your notice.
It looks like I've made a couple of mistakes in the original code. I've just uploaded a new version. It would appear in a couple of days.

For now, you may just replace
"ishandle_scalar( FigureHandle )"
with
"isscalar( FigureHandle ) && ishandle( FigureHandle )".

26 Jun 2013 Christine

Hello Igor,
I would very like to use your WinOnTop function but I always get an error message because of the ishandle_scalar function that does not seem to exist in my matlab path. Is it possible, that this function does not exist for my version (matlab 7.9 (R2009b)) and was only implemented in a later version? Can I get somehow around using it?

Thanks,
Christine

20 Jun 2013 Igor

oops...
Edit:
This version is based on
get(handle(gcf),'JavaFrame') in contrast to
get(gcf,'JavaFrame') ... <blah-blah-blah>

18 Jun 2013 Igor

This version is based on get(gcf,'JavaFrame') which won’t return “Warning: figure JavaFrame property will be obsoleted in a future release.”, in contrast to get(gcf,'JavaFrame'), but it’s still possible that it would become obsolete in some future release. Though, most probably, there would be other workaround available.
See
http://undocumentedmatlab.com/blog/minimize-maximize-figure-window/
… and
https://www.mathworks.com/matlabcentral/newsreader/view_thread/246453#656957

Updates
27 Jun 2013

couple of critical fixes

Contact us