Thread Subject: Does Matlab need better GUI controls?

Subject: Does Matlab need better GUI controls?

From: John Ramshur

Date: 14 Apr, 2009 03:37:01

Message: 1 of 11

With having experience programming in VB, VB.NET, and ASP.NET i've been disappointed in Matlab's GUI controls. Don't get me wrong Matlab is great for mathematical programming, but when you want to build a mathematical/scientific GUI it just seems to be behind others on the control styling.

I'm in vista...I don't want a windows 98 looking GUI. Plus it wouldn't hurt to add some more types of controls and pull the uitab out of the "undocumented" section.

I'm curious to hear others comment.

Subject: Does Matlab need better GUI controls?

From: Matt Fig

Date: 14 Apr, 2009 03:57:01

Message: 2 of 11

"Need?" Maybe not.

Would I like an upgrade too? Sure, why not. Most of the GUIs I write are for instrument controls, and I don't really care about what they look like as long as they get the job done.

Subject: Does Matlab need better GUI controls?

From: Nasser Abbasi

Date: 14 Apr, 2009 04:56:43

Message: 3 of 11


"Matt Fig" <spamanon@yahoo.com> wrote in message
news:gs11id$fs2$1@fred.mathworks.com...
> "Need?" Maybe not.
>
> Would I like an upgrade too? Sure, why not. Most of the GUIs I write
> are for instrument controls, and I don't really care about what they look
> like as long as they get the job done.

True. But real tabbed GUI menus is a big missing item in Matlab GUI. As in

http://blogs.mathworks.com/pick/2007/03/08/tabbed-guis/

With tabbed GUI, one can manage controls better when there many of them.
Right now, one has to put all control on one figure and it becomes cluttered
as more controls are added.

This has been discussed before, and the undocumented uitab was mentioned
here

http://mathforum.org/kb/message.jspa?messageID=4996038&tstart=0

This was 3 years ago. Does Matlab 2009a has this GUI feature officially
now?

--Nasser



Subject: Does Matlab need better GUI controls?

From: Malcolm Lidierth

Date: 14 Apr, 2009 11:54:01

Message: 4 of 11

To get more control over appearance, and much else, you can add java swing components using Yair Altman's uicomponent
http://www.mathworks.com/matlabcentral/fileexchange/14583
or my own jcontrol
http://www.mathworks.com/matlabcentral/fileexchange/15580
ML

Subject: Does Matlab need better GUI controls?

From: Dave Robinson

Date: 14 Apr, 2009 15:00:03

Message: 5 of 11

"John Ramshur" <jramshur@gmail.com> wrote in message <gs10ct$rfm$1@fred.mathworks.com>...
> With having experience programming in VB, VB.NET, and ASP.NET i've been disappointed in Matlab's GUI controls. Don't get me wrong Matlab is great for mathematical programming, but when you want to build a mathematical/scientific GUI it just seems to be behind others on the control styling.
>
> I'm in vista...I don't want a windows 98 looking GUI. Plus it wouldn't hurt to add some more types of controls and pull the uitab out of the "undocumented" section.
>
> I'm curious to hear others comment.

Thinking aloud here, I haven't tried it, but wouldn't it be relatively straightforward to implement your GUI in say C# and have this communicate to your Matlab via a TCP/IP link on 127.0.0.1, so they co-existed in the same machine - Matlab handles sockets. The various buttons etc. could communicate to the Matlab via a series of strings or similar, and Matlab would interpret these with something I would imagine looked like a switch statement calling the functions that the Guide GUI would have called in the first place.

Data coming from Matlab to the GUI would be handled the same way, but in reverse. True one would need to designe the actual communication protocol between the two applications rather carefully, but on face value, it looks do-able.

This way you get the good looking graphic interface together with the number crunching might of Matlab,

Regards

Dave Robinson

Subject: Does Matlab need better GUI controls?

From: Matt Fig

Date: 14 Apr, 2009 17:34:01

Message: 6 of 11

"Nasser Abbasi" <nma@12000.org> wrote in message
> True. But real tabbed GUI menus is a big missing item in Matlab GUI.


Speaking of tabbed GUIs, I am curious how others have implemented the idea of tabs without having them. This trivial GUI shows how I usually do it. How do others "fake it?"



function [] = panels()
% Fake tabs are no tabs.
SCR = get(0,'Screensize');
fp = [SCR(3)/2-200 ,SCR(4)/2-200 , 400, 400];
W = {'units','pixels','position'};
hf = figure('Numbert','of','Menu','no',W{:},fp,'Name','Fun Quartics');
S.ax = axes(W{:},[50 100 300 230]);
S.pb1 = uicontrol(hf,'sty','push',W{:},[50 20 300 40],'str',...
                  'Plot Random Quartic Polynomial','fonts',12);
S.tg(1) = uicontrol(hf,'sty','tog',W{:},[50 355 60 40],...
                    'str','PLOT','val',1);
S.tg(2) = uicontrol(hf,'sty','tog',W{:},[110 355 60 40],...
                    'str','FIT','val',0,'enable','off');
W = {'style','edit',W{:}};
S.ed(5) = uicontrol(hf,W{:},[50 100 300 30]);
S.ed(4) = uicontrol(hf,W{:},[50 140 300 30]);
S.ed(3) = uicontrol(hf,W{:},[50 180 300 30]);
S.ed(2) = uicontrol(hf,W{:},[50 220 300 30]);
S.ed(1) = uicontrol(hf,W{:},[50 260 300 30]);
set(S.pb1,'callback',{@pbcall,S})
set(S.tg(:),{'callback'},{{@tgcall,S}})
set(S.ed(:),'visible','off','fontsize',12,'fontweight','b')


function [] = pbcall(varargin)
% Callback for pushbutton.
S = varargin{3};
x = -10:.1:10;
plot(S.ax,x,polyval(-5 + ceil(rand(1,5)*7),x));
set(S.tg(2),'enable','on');


function [] = tgcall(varargin)
% Callback for togglebutton.
S = varargin{3};
stat = get(S.tg(:),'val');

if ~all([stat{:}])
    set(varargin{1},'val',1);
    return
end

L = get(S.ax,'children');

switch varargin{1}
    case S.tg(1)
        set([S.ax,S.pb1,L],{'visible'},{'on'})
        set(S.ed(:),{'visible'},{'off'})
        set(S.tg(2),'val',0)
    case S.tg(2)
        STR = 'The x^0 coefficient is: ';
        set(S.tg(1),'val',0)
        set([S.ax,S.pb1,L],{'visible'},{'off'})
        set(S.ed(:),{'visible'},{'on'})
        p = round(polyfit(get(L,'xdata'),get(L,'ydata'),4));
        for ii = 0:4
            STR(7) = num2str(ii);
            set(S.ed(5-ii),'str',[STR,num2str(p(5-ii))])
        end
end

Subject: Does Matlab need better GUI controls?

From: matt dash

Date: 14 Apr, 2009 18:38:01

Message: 7 of 11

On original topic: The only thing I really wish they had was a better slider, and that's the only uicontrol I routinely replace with a JSlider. Scrollbars ~= sliders! If you're using vista the components should show up using the vista look and feel, unless you change the backgroundcolor property, then you'll get the old xp controls. I occasionally use other swing components when I want to do something fancy, like add an icon to a button.

On making tabs: I wrote a small program to spit out x/y coordinates for a specified number of tabs with the specified tab "on top". I make an axes and literally draw the tabs with a line object, and use text() to fill in the names. The buttondownfcn's for the text objects load the appropriate tab uicontrols (deleting the old ones) and also recalculate the tab coordinates to make that tab be on top. It doesnt have the nice shaded borders of a real tabpane, but it is clean and effective and looks acceptable with any look and feel.

Subject: Does Matlab need better GUI controls?

From: Budias Aao

Date: 14 Apr, 2009 20:38:01

Message: 8 of 11

"John Ramshur" <jramshur@gmail.com> wrote in message <gs10ct$rfm$1@fred.mathworks.com>...
> With having experience programming in VB, VB.NET, and ASP.NET i've been disappointed in Matlab's GUI controls. Don't get me wrong Matlab is great for mathematical programming, but when you want to build a mathematical/scientific GUI it just seems to be behind others on the control styling.
>
> I'm in vista...I don't want a windows 98 looking GUI. Plus it wouldn't hurt to add some more types of controls and pull the uitab out of the "undocumented" section.
>
> I'm curious to hear others comment.

IMO Matlab needs a whole new handle graphics system. The current one, sorry but that's what feel, just sucks.
I don't know any graphics software so bad. If we feed it a somewhat large data it stalls. The memory usage is unbelievable. Default figure settings are pathetic with an enormous space wasting.

Subject: Does Matlab need better GUI controls?

From: per isakson

Date: 15 Apr, 2009 02:02:58

Message: 9 of 11

"John Ramshur" <jramshur@gmail.com> wrote in message <gs10ct$rfm$1@fred.mathworks.com>...
> With having experience programming in VB, VB.NET, and ASP.NET i've been disappointed in Matlab's GUI controls. Don't get me wrong Matlab is great for mathematical programming, but when you want to build a mathematical/scientific GUI it just seems to be behind others on the control styling.
>
> I'm in vista...I don't want a windows 98 looking GUI. Plus it wouldn't hurt to add some more types of controls and pull the uitab out of the "undocumented" section.
>
> I'm curious to hear others comment.

"Windows 98 looking GUI" fits me. It helps me ignore visual appearance.

However, I miss a number of controls that were taken for granted at the time of Windows 98. How come it take years from the first appearance of new controls until they become mature enough to be documented (e.g. uitable, uitab, uitree)?

/ per
 

Subject: Does Matlab need better GUI controls?

From: Richard de Garis

Date: 25 May, 2009 14:26:02

Message: 10 of 11

"Budias Aao" <budiao@hotmail.com> wrote in message <gs2s79$jn4$1@fred.mathworks.com>...
> "John Ramshur" <jramshur@gmail.com> wrote in message <gs10ct$rfm$1@fred.mathworks.com>...
> > With having experience programming in VB, VB.NET, and ASP.NET i've been disappointed in Matlab's GUI controls. Don't get me wrong Matlab is great for mathematical programming, but when you want to build a mathematical/scientific GUI it just seems to be behind others on the control styling.
> >
> > I'm in vista...I don't want a windows 98 looking GUI. Plus it wouldn't hurt to add some more types of controls and pull the uitab out of the "undocumented" section.
> >
> > I'm curious to hear others comment.
>
> IMO Matlab needs a whole new handle graphics system. The current one, sorry but that's what feel, just sucks.
> I don't know any graphics software so bad. If we feed it a somewhat large data it stalls. The memory usage is unbelievable. Default figure settings are pathetic with an enormous space wasting.

In contrast to many of the folks here, I do not have much application development experience; however, it does appear to me that the GUI user experience is rather limited compared to some of the rich applications that the general public now get enjoy and even consider to be standard fare - for example Adobe's Lightroom has tabbed panels and sliding panels, as well as drag and drop functionality within the GUI.

Another area that overlaps this topic is printing; if one has multiple tabs, is it possible to individually print the contents of each tab? Actually, it should not only be possible, but a relatively easy process for the user to publish a page-layout through the GUI.

Overall I am finding MATLAB to be an excellent development environment on the computational side of an application, but a little weak on the tool-set for GUIs and printing.

Here's hoping the good folks at MathWorks can address everyone's issues here in near-future releases.

Subject: Does Matlab need better GUI controls?

From: Pekka Kumpulainen

Date: 25 May, 2009 19:30:04

Message: 11 of 11

"Budias Aao" <budiao@hotmail.com> wrote in message <gs2s79$jn4$1@fred.mathworks.com>...
> "John Ramshur" <jramshur@gmail.com> wrote in message <gs10ct$rfm$1@fred.mathworks.com>...

> IMO Matlab needs a whole new handle graphics system. The current one, sorry but that's what feel, just sucks.

They are building a completely new graphics system. The current one has been stretched pretty much to its limits.
But it will not be ready in 2010 releases yet. That's what I was told in TMW user conference. Let's hope they get all the right things in and no bad ones ;-)
Maybe it is a time to send the wish lists in again.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
tooglebutton Sprinceana 21 Aug, 2009 07:00:30
slider Gautam Vallabha 14 Apr, 2009 20:54:45
graphics Gautam Vallabha 14 Apr, 2009 20:54:22
uicontrol Gautam Vallabha 14 Apr, 2009 20:54:21
upgrade John Ramshur 13 Apr, 2009 23:40:03
gui John Ramshur 13 Apr, 2009 23:40:03
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com