Rank: 118779 based on 0 downloads (last 30 days) and 0 file submitted
photo

Eckhard Lehmann

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Eckhard
Updated File Comments Rating
07 Mar 2011 Figure Window Always on Top Avoid obscuring figure windows by ensuring they always remain on top. Author: John Anderson

Great way to make windows always visible! I wish this was built into core MATLAB and available on other platforms too.

I've created a small patch to the file that allows to use other window names than "Figure X", i.e. for GUIDE windows or named figures. The original Author might want to incorporate it into his version:

14c14,15
< char *windowName, n = 1;
---
> char *windowName, *ntSwitch, n = 1;
> mxArray *windowNameProp, *numberTitleProp; /* for getting the window name */
26,27d26
< windowName = mxCalloc(1, sizeof(figureHandle)+8);
< sprintf(windowName, "Figure %d", figureHandle);
30c29
< if( mexGet(figureHandle, "Visible") == NULL )
---
> if( mexGet(figureHandle, "Visible") == NULL ) {
32a32,48
> }
>
> windowNameProp = mexGet(figureHandle, "Name");
> windowName = mxArrayToString(windowNameProp);
>
> numberTitleProp = mexGet(figureHandle, "NumberTitle");
> ntSwitch = mxArrayToString(numberTitleProp);
> if (strcmp(ntSwitch, "on") == 0) {
> if (strlen(windowName) == 0) {
> windowName = mxCalloc(1, sizeof(figureHandle)+8);
> sprintf(windowName, "Figure %d", figureHandle);
> } else {
> char *wBuf = windowName;
> windowName = mxCalloc(1, sizeof(figureHandle)+10+strlen(windowName));
> sprintf(windowName, "Figure %d: %s", figureHandle, wBuf);
> }
> }

Contact us