MATLAB Answers

Uitables and widgets question

조회 수: 4(최근 30일)
James Hendren
James Hendren 25 Jun 2013
I have 2 questions.
1) Can checkboxes be implemented into the UItable when building a gui.
2) If so, can rows and checkboxes be added dynamically to the UItable.

  댓글 수: 0

로그인 to comment.

채택된 답변

Tom
Tom 25 Jun 2013
Tom 님이 편집함. 25 Jun 2013
1) Yes
2) Yes
you can change the column format of the table at any point, using the ColumnFormat field of the uitable:
T = uitable('Data',{'a',false;'b' true},...
'ColumnFormat',{[] , 'numeric'},...
'ColumnEditable',[false true]);
pause(1)
set(T,'ColumnFormat',{[],'logical'})

  댓글 수: 0

로그인 to comment.

More Answers (4)

James Hendren
James Hendren 25 Jun 2013
Is your sample for question 1 or 2?

  댓글 수: 1

Tom
Tom 25 Jun 2013
2 I suppose, it's not specific to GUIDE - you can run it in the command line or paste it into a script and run it. It shows a table being created, and then the second column being converted from numeric data to logical checkboxes.

로그인 to comment.


James Hendren
James Hendren 25 Jun 2013
I am not getting checkboxes when I run it

  댓글 수: 0

로그인 to comment.


James Hendren
James Hendren 25 Jun 2013
I meant literal checkboxes from the GUIDE program

  댓글 수: 14

표시 이전 댓글 수: 11
Tom
Tom 25 Jun 2013
I just picked it up over time. Be aware that I didn't create that code using GUIDE, I did it manually but used the same handles format that GUIDE uses. You might want to watch the 'Creating a GUI using GUIDE' video in the MATLAB help documentation
James Hendren
James Hendren 25 Jun 2013
I have, but there is alot left out from the guide. For instance, I could not insert a checkbox into the table. Is there another source you would suggest?
Tom
Tom 25 Jun 2013
To do it in GUIDE, you right click on the table, select Table Property Editor, then in the Columns tab there is an option to select what data format each column will take: make it 'logical'.

로그인 to comment.


James Hendren
James Hendren 26 Jun 2013
Also, how could I install another push button "Remove Row" to delete all new created rows. Is there a way to implement add/remove buttons with GUIDE?

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by