Variable amount of checkboxes in listbox (programmatic GUI)
35 views (last 30 days)
I have in my programmatic GUI the following listbox:
h.listbox = uicontrol('style','listbox','units','pixels',...
The entire program gives me the following output:
What I now want, is that in front of every stock, I have a checkbox. Keep in mind that the amount of stocks is variable.
Can anyone point towards a solution?
Thanks in advance,
Adam on 26 Aug 2014
I don't think that is possible with Matlab UI controls. However, if you don't mind doing some experimentation with undocumented controls, the following information on Yair Altman's excellent blog may help:
More Answers (1)
Yair Altman on 4 Sep 2014
There are actually 2 built-in controls that you could use within Matlab:
Usage example (more details in my Matlab-Java book):
jList = java.util.ArrayList; % any java.util.List will be ok
jCBList = com.mathworks.mwswing.checkboxlist.CheckBoxList(jList);
jScrollPane = com.mathworks.mwswing.MJScrollPane(jCBList);
[jhCBList,hContainer] = javacomponent(jScrollPane,[10,10,80,65],gcf);
set(jCBList, 'ValueChangedCallback', @myMatlabCallbackFcn);
jCBModel = jCBList.getCheckModel;