It bothered me that the resulting data structure in Matlab has both xtr_base and reg_base the same. I tried using Pref.CellItem=true, as in the following commands:

This did produce a difference between xtr_base and reg_base, but the pcm_base was now a cell-array within a cell-array! So, I decided to make a modification to your code...

So now, with my small modification, I do the following commands:

... which is probably not exactly as it should be. So, maybe my modification is not entirely correct.

What I did was to change lines 383-387 from this:
if (isfield(s,Pref.ItemName))
s.CONTENT = s.(Pref.ItemName);
s = rmfield(s,Pref.ItemName);
ItemContent = Pref.CellItem; % if CellItem than keep s.CONTENT as cells
end

to be this instead:
if (isfield(s,Pref.ItemName))
% Check for singleton nodes that have the special keyword to mark arrays,
% and keep them as cell arrays, even though the resulting cell array
% only has one member. -- Modification by John Clayton, 12/22/11.
if ~iscell(s.(Pref.ItemName))
s.CONTENT = s.(Pref.ItemName);
s = rmfield(s,Pref.ItemName);
ItemContent = true;
else
s.CONTENT = s.(Pref.ItemName);
s = rmfield(s,Pref.ItemName);
ItemContent = Pref.CellItem; % if CellItem then keep s.CONTENT as cells
end
end

What do you think of this change? Perhaps I did it not very well, but I wanted to tell you about it.

This is exactly what I was looking for! Thanks so much, it was clearly described and worked well for me. I made one small modification - adding a new argument which allows loading an arbitrary image into the icon. If the image file is not found, then the standard icon is used. Once again, I appreciate this!

@David
Not sure if that is possible. As I recall GScroller only worked because of a quirk in the MATLAB code that let me set normalized sizes >1. I doubt uicontrols would allow that.

Comment only

24 Oct 2013

Making MATLAB Swing
TabbedPanes, SplitPanes, SideBars, ScrollPanes etc for MATLAB

Thank you very much!!
I would like to use the GScroller but instead of putting imagesc inside the uipanels, I would like to put uicontrol. With uicontrols, when I use the scroll bar, they are still visible even when they are outside the uipanel. I think there is a clipping problem but I checked and I can't see anything...
Could you help me on that subject?
Thank you!

5

19 Jan 2013

Making MATLAB Swing
TabbedPanes, SplitPanes, SideBars, ScrollPanes etc for MATLAB

@Doug
Many thanks. Looks like MATLAB is insisting on pass-by-value syntax in R2012b:
For backwards compatibility, I avoid [~], but your fix seems to work equally well with:
obj.hgcontainer=subsasgn(obj.hgcontainer, index, val);
Same problem could also arise at line 38. Change to:
obj.(index(1).subs)=subsasgn(obj.(index(1).subs), index(2:end), val);
FYI: Latest code for this is now in a GIT repo. See:
http://waterloo.sourceforge.net
Regards
Malcolm

Comment only

19 Jan 2013

Making MATLAB Swing
TabbedPanes, SplitPanes, SideBars, ScrollPanes etc for MATLAB

New in 2012b I'm getting getting the following warning in a waterloo(1.08) dependent GUI:
Warning: SUBSASGN must be called with an output.
> In jcontrol.subsasgn at 57
In GSplitPaneDivider>GSplitPaneDivider.GSplitPaneDivider at 62
In GSplitPane>GSplitPane.GSplitPane at 97
etc.
Temporary fix was to modify line 57 on subsasgn.m to include a dummy assignment, e.g.
[~] = subsasgn(obj.hgcontainer, index, val);
Just passing the word back. Great tool, thanks guys!

5

22 Nov 2012

Making MATLAB Swing
TabbedPanes, SplitPanes, SideBars, ScrollPanes etc for MATLAB

An "alpha" version of Waterloo 1.1 is now available on SourceForge. This includes a new Java library for scientific graphics that can be called from Java, Groovy, Scala, MATLAB, the R statistical environment and SciLab.
For MATLAB, a MATLAB-like API is provider using custom MATLAB OOP wrappers.
For details and downloads see the new website at:
http://waterloo.sourceforge.net/

Comment only