From: Bruce Bowler on
It's my first foray into UI programming in matlab so undoubtably I'm
doing something stupid, but I don't see it...


I have a uitable in which the first column is X, the second column is a
validity flag and the next column is Y.

I have the following in the setup part of the code.

set(handles.edTable,'columnname',{'x','valid','y'});
set(handles.edTable,'columnEditable',[0 1 0]);
set(handles.edTable,'columnFormat',{[],'logical'});

and I load the table with...

tableData = [x ones(size(depth)) y];
set(handles.edTable,'data',tableData);

Despite having a column of 1's, none of the check boxes are checked - Why?

Later, when I click on a check box in the table, I get

Warning: Cannot convert logical edit to numeric matrix.
Please click for more information

and clicking on the "click for more info" gives me

??? Error using ==> helpview at 200
Specified topic id (NaN_column_error) does not exist in map file C:
\Program Files\MATLAB\R2009b\help\techdoc\ref\ref.map.

Digging a bit further, I find the celleditcallback, so I add the
following after the other sets (as seen above)

set(handles.edTable,'cellEditCallback',@tableChangeCallback);

and when I examine the structure passed in, low and behold, the previous
value is 1, which is as I expected...

Why can't I get the check boxes to work as I expect in a uitable?

Thanks!
Bruce

--
+-------------------+---------------------------------------------------+

Bruce Bowler | A Canadian is someone who knows how to make love

1.207.633.9610 | in a canoe.

bbowler(a)bigelow.org | - Pierre Barton

+-------------------+---------------------------------------------------+

From: Bruce Bowler on
On Tue, 15 Jun 2010 19:30:09 +0000, Bruce Bowler set fingers to keyboard
and typed:

> It's my first foray into UI programming in matlab so undoubtably I'm
> doing something stupid, but I don't see it...

[snippage]

> tableData = [x ones(size(depth)) y];

The "stupidity" was assuming that matlab would treat "ones" as "true" so
the above should be...

tableData = [num2cell(x), num2cell(true(size(x))), num2cell(y)];

Bruce