From: Matt Dunham on
I'd like to hide the Matlab IDE menu bar, i.e. the bar at the top that has "file", "edit", "debug", etc, to save screen realestate. The following code almost does it:

I = com.mathworks.mde.desk.MLDesktop.getInstance
I.getMainFrame.getJMenuBar.setVisible(0)

except that the bar reappears whenever you click on the editor or back onto the command window. Anyone know how to turn this off?
From: Jan Simon on
Dear Matt,

> I'd like to hide the Matlab IDE menu bar, i.e. the bar at the top that has "file", "edit", "debug", etc, to save screen realestate. The following code almost does it:
> I = com.mathworks.mde.desk.MLDesktop.getInstance
> I.getMainFrame.getJMenuBar.setVisible(0)
> except that the bar reappears whenever you click on the editor or back onto the command window. Anyone know how to turn this off?

Sorry for not answering.
What do you want to achieve by hiding the menubar??

Jan
From: Matt Dunham on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <hvtd9e$844$1(a)fred.mathworks.com>...
> Dear Matt,
>
> > I'd like to hide the Matlab IDE menu bar, i.e. the bar at the top that has "file", "edit", "debug", etc, to save screen realestate. The following code almost does it:
> > I = com.mathworks.mde.desk.MLDesktop.getInstance
> > I.getMainFrame.getJMenuBar.setVisible(0)
> > except that the bar reappears whenever you click on the editor or back onto the command window. Anyone know how to turn this off?
>
> Sorry for not answering.
> What do you want to achieve by hiding the menubar??
>
> Jan

Increased screen real estate. I'm working on a small laptop, and I almost never use the menubar. Ideally, there would be a keyboard shortcut to hide and reveal it.
From: Jan Simon on
Dear Matt,

I tried it hard to increase the window size until the menubar is out of the screen:
frame = com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame;
frame.setBounds(-4, -44, 1040, 900);
But, unfortunately, this does not increase the width to more than 780 pixels on my 1024x768 monitor. Note: 780 versus 768 ?!
No success for frame.setSize, frame.setMaximumSize, frame.reshape also.

There is the ugly behaviour of Matlab figures on Windows, which prevent setting the property 'Position' to the complete visible screen size:
figure('Position', [0, 0, 1023, 767])
Moves the figure to unexpected locations.
But this can be solved by calling the Windows-API function SetWindowPos together with the SWP_NOSENDCHANGING flag in a C-Mex. In combination with the HWND_TOPMOST flag, I got the full visible screen.
Nevertheless, I did not try to use it to resize the main frame and I do not know a solution for Linux.

Yair, we need your advice.

Jan
From: Yair Altman on
> I tried it hard to increase the window size until the menubar is out of the screen:
> frame = com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame;
> frame.setBounds(-4, -44, 1040, 900);
[...]
> Yair, we need your advice.


To the rescue:

jDesktopFrame = com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame;
jDesktopMenu = jDesktopFrame.getRootPane.getMenuBar;
jDesktopMenu.setVisible(0);
jDesktopMenu.repaint;

Yair Altman
http://UndocumentedMatlab.com