Comments on: Setting status-bar components https://undocumentedmatlab.com/blog_old/setting-status-bar-components Charting Matlab's unsupported hidden underbelly Thu, 02 May 2024 08:00:01 +0000 hourly 1 https://wordpress.org/?v=4.4.1 By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-462147 Fri, 15 Feb 2019 10:51:29 +0000 https://undocumentedmatlab.com/?p=478#comment-462147 Matlab’s statusbar hack only works with non-docked figures. If you need them to work also in docked figures, replicate the functionality using regular panels.

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-462146 Fri, 15 Feb 2019 10:48:59 +0000 https://undocumentedmatlab.com/?p=478#comment-462146 Jan – if you mean the controls in the statusbar, the only controls that change their relative position are the ones that are attached to right (“East”) border, such as the “Next phase” button in my example in the post. If you wish them to remain in the same relative position, attach them to the left (“West”) instead.

]]>
By: Gu Bo Yuhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-457519 Wed, 16 Jan 2019 04:31:14 +0000 https://undocumentedmatlab.com/?p=478#comment-457519 Hi
The statusbar will vanished when there exsiting two or more docked figures.
The statusbar needed to be fixed in the container?
May you give me some advices?
Thanks!

]]>
By: Gu Bo Yuhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-457518 Wed, 16 Jan 2019 04:21:18 +0000 https://undocumentedmatlab.com/?p=478#comment-457518 hi,I have a problem when useing the statusbar.
I find that the statusbar will be vanished when exsiting two docked figures.
May you give me some advice?
Thanks

]]>
By: Jan Grajciarhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-455794 Wed, 12 Dec 2018 19:36:40 +0000 https://undocumentedmatlab.com/?p=478#comment-455794 Hi,
did anyone find a way to fix the controls, so they do not move when I change the window size?

Thx
Jan

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-374778 Thu, 21 Apr 2016 10:37:45 +0000 https://undocumentedmatlab.com/?p=478#comment-374778 @anon – see here: https://undocumentedmatlab.com/blog/setting-status-bar-text

]]>
By: anonhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-374760 Thu, 21 Apr 2016 03:41:43 +0000 https://undocumentedmatlab.com/?p=478#comment-374760 i want to make status bar that when user enter their name, the status state ‘User enter Name’ when user want to enter the age, the status change to ‘User enter Age’. How can i make it like that ?

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-367554 Sat, 16 Jan 2016 17:18:08 +0000 https://undocumentedmatlab.com/?p=478#comment-367554
statusbarObj = com.mathworks.mwswing.MJStatusBar;
newLayout = java.awt.GridLayout(2,3);  % 2 rows, 3 cols
statusbarObj.setLayout(newLayout);
...  % add content to the statusbarObj container
rootPane = jFrame.fHG2Client.getWindow;  % See https://undocumentedmatlab.com/blog/hg2-update#observations item #2
rootPane.setStatusBar(statusbarObj);
]]>
By: Shalinhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-367457 Fri, 15 Jan 2016 16:05:08 +0000 https://undocumentedmatlab.com/?p=478#comment-367457 Also, I tried your way of making JAVA root frame but it gives error.

RootPane = jFrame.fFigureClient.getWindow;
No appropriate method, property, or field ‘fFigureClient’ for class ‘com.mathworks.hg.peer.HG2FigurePeer’.

I think, it doesn’t work on Matlab 2015 as they suggest here – http://www.mathworks.com/matlabcentral/answers/196352-sim-i-am-gets-an-error

Not sure though! Sorry for spamming.

]]>
By: Shalinhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-367453 Fri, 15 Jan 2016 15:52:13 +0000 https://undocumentedmatlab.com/?p=478#comment-367453 Hello again,

So I was trying around status bar and I was trying to add a gridlayout or flowlayout to it so that I can do whatever I like with the layout of status bar but somehow none of the layouts allow statusbar handle. Any idea on that? I know, I can add any JAVA component once I have a layout handle so I was trying to add a gridlayout to status bar and then a couple of JAVA UI components to add.

]]>
By: Greghttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-345436 Tue, 10 Feb 2015 14:26:04 +0000 https://undocumentedmatlab.com/?p=478#comment-345436 I have been having this problem since the R2014b prerelease on both Windows and Linux platforms.

I seem to have gotten a reasonably stable workaround by adding the following lines to the end of my function that creates the status bar:

old_pos = get(h_fig,'Position');
set(h_fig,'Position',1.05.*old_pos);
set(h_fig,'Position',old_pos);

This seems to be giving me a consistent appearance when the GUI is first displayed. If it is then resized graphically (by dragging the window corner), the GUI components still jump up and down randomly. But, if you disable window resizing (or, you know, just don’t try to resize it), the GUI appears stable.

Interestingly, if you don’t store the old position before the first change, you can’t appear to recreate it from the new position. For example, the following code does not work correctly:

set(h_fig,'Position',1.05.*get(h_fig,'Position'));
set(h_fig,'Position',get(h_fig,'Position')./1.05);
]]>
By: Markhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-344649 Fri, 23 Jan 2015 09:40:33 +0000 https://undocumentedmatlab.com/?p=478#comment-344649 Dear Yair,

Thanks for again a wonderful contribution!

However, I found a small bug, at least on my system. When creating a statusbar using your ‘statusbar’ function from the File Exchange, the other controls are properly placed in the beginning. But when I then move the window, all controls suddenly shift down (I guess 20 pixels). Is seems that MATLAB is not aware of the ‘extra space’ for the status bar when redrawing the controls.

I use MATLAB 2014b on Windows 7. I cannot test if this is also the case in older versions.

Is this a problem on my system, or is it solvable in the statusbar function?

Thanks in advance!

Best,
Mark

]]>
By: Luis Camilohttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-343882 Mon, 12 Jan 2015 05:11:27 +0000 https://undocumentedmatlab.com/?p=478#comment-343882 Thanks for yours answers Yair.
Could you help me with these questions?
1. How I can include spinning icon in the status bar?
2. How I can close the place where the status bar and the Paneltext is loacted , after having used it and and change its color to transparent?
3. How I can change the dimension of the status bar?
Thank You for your time and patience with my questions..

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-329382 Sun, 10 Aug 2014 06:23:25 +0000 https://undocumentedmatlab.com/?p=478#comment-329382 @Luis – you cannot do it in GUIDE, only programmatically

]]>
By: luis camilohttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-329379 Sun, 10 Aug 2014 05:25:30 +0000 https://undocumentedmatlab.com/?p=478#comment-329379 How can I modify the position of the statusbar in a GUIDE, for example [10,10, 150, 200]? thanks!

]]>
By: nir S.https://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-140126 Thu, 10 Jan 2013 07:43:14 +0000 https://undocumentedmatlab.com/?p=478#comment-140126 thanks

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-139374 Mon, 07 Jan 2013 10:09:18 +0000 https://undocumentedmatlab.com/?p=478#comment-139374 @Nir – no. All the fancy GUI stuff needs Java. You can use this on all Matlab releases of the past decade. If you are scared about future releases then settle for Matlab’s plain-vanilla GUI or use a non-Matlab GUI to begin with.

]]>
By: nir S.https://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-139098 Sun, 06 Jan 2013 06:55:30 +0000 https://undocumentedmatlab.com/?p=478#comment-139098 Hi Yair,

It seems that matlab won’t support JavaFrame in future versions of Matlab.
are there any other way to intgrated the waitbar in my GUI?

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-3417 Thu, 22 Oct 2009 22:49:26 +0000 https://undocumentedmatlab.com/?p=478#comment-3417 Aurélien – you are correct: For performance reasons, the statusbar object is not really deleted when you issue

statusbar;

Instead, it is simply made invisible using the root-pane’s setStatusBarVisible(0) method in line #222. Then, when you recreate the statusbar, adding the internal handles to the CornerGrip, TextPanel and ProgressBar fails, since these properties already exist in the old (previously-hidden) statusbar object.

Your solution, to comment line #263, is probably the easiest and best.

]]>
By: Aurélien Queffurusthttps://undocumentedmatlab.com/blog_old/setting-status-bar-components#comment-3409 Thu, 22 Oct 2009 09:52:15 +0000 https://undocumentedmatlab.com/?p=478#comment-3409 Hello Yair,

I am using statusbar in my codes since I prefer waitbar docked. I wanted to know how to delete this object in a safe way.
In the help, I can read that the command

statusbar;

deletes status bar from current figure. But I had to comment the line 263 :

lasterr

to prevent the message : Property Name already in use . It happens each time I recreate a statusbar or when I display a dialog box.

I guess that :

jProgressBar.setVisible(0);

is not enough to delete this object.

Thanks,
Aurélien

]]>