I know this has been asked (I've read all the other posts on this same issue), but I'm not having luck with the "official" way of doing this.
I am trying to make an entire row of a table (set in Hot mode) to become selected if any of its cells are clicked. Here is my callback:
int CVICALLBACK TableTest (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { Point cell; switch (event) { case EVENT_LEFT_CLICK: GetTableCellFromPoint(panel,control,MakePoint(eventData2,eventData1),&cell); if (cell.x == 0 && cell.y == 0) return 1; // Not on a row/col SetTableSelection(panel,control,VAL_TABLE_ROW_RANGE(cell.y)); break; } return 0;
What I'm seeing is that the SetTableSelection just doesn't do what it's supposed to do. I can break the function at the GetTableCellFromPoint and I can see the correct row get put into cell.y, but then selecting the row fails.
I found a good comment on this other thread about the control mode of the table. That poster claimed that if the table is in non-Indicator mode, my callback should swallow the event. Ok, I tried that and it sort of works. I can see the row selected, but it's a strange highlighted effect, not a solid dark gray cell background. See the attachment (I've highlighted the row that had been clicked).
Which leads to more questions. On a Hot table, with traditional events that are NOT swallowed, which event is creating the dark gray background selection of a cell?
For grins, I also tried putting my table into Indicator mode and not swallowing any events. But there there is no selections at all.
So I'm just very confused about this. What am I doing wrong?