Use uitable with static text?

2 views (last 30 days)
Birch
Birch on 29 Aug 2017
Commented: JB on 30 Aug 2017
Please help. I am preparing a GUI (guide) and have a couple of questions:
1) from a pushbutton I want to import the filename of all .txt files in the directory and place the filename in a uitable as static text.
2) in the uitable I want only one row to start with, but add one new empty row at the end to add new info manually. This should be a uigetfile, potentially through a pushbutton, to allow the user to include other .txt files located outside the dir. Every time the last row is filled it should automatically add a new empty row to the uitable. And finally:
3) import all the .txt (mixed data and char) files specified in the uitable potentially via a loop to generate mixed data arrays.
I know this is a lot but hopefully someone can help me. I am open to better suggestions if any. THANKS a lot.

Answers (1)

Walter Roberson
Walter Roberson on 29 Aug 2017
uitable cannot have static text exactly. You can set a cell to a string and set the associated ColumnEditable to false, but that affects all entries in the column which might be a problem as you also want users to be able add new entries.
You can can set the celledit callback to set the contents back if they are changed.
You will need one of those callback functions to detect that the user has entered something so that you would know to add a new row.
  3 Comments
JB
JB on 30 Aug 2017
AWESOME Walter, thanks a lot.

Sign in to comment.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!