From e7513d7daa4fa192d2c6da8dd0a4932fedf61963 Mon Sep 17 00:00:00 2001 From: Jess Haley Date: Sun, 15 Mar 2026 17:35:35 -0700 Subject: [PATCH 1/2] Fixed double click bug Issue with nansen.App in the function onMouseDoubleClickedInTable. app.UiMetaTableViewer.getColumnNames returns the ColumnLabel but VariableName is returned by app.getTableVariableAttributes('HasDoubleClickFunction') . If the column label is different from it's variable name, no match is found. This fixes it. --- code/apps/+nansen/@App/App.m | 2 +- code/apps/+nansen/@MetaTableViewer/MetaTableViewer.m | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/apps/+nansen/@App/App.m b/code/apps/+nansen/@App/App.m index acb1250c..6c71dcf7 100644 --- a/code/apps/+nansen/@App/App.m +++ b/code/apps/+nansen/@App/App.m @@ -1395,7 +1395,7 @@ function onMouseDoubleClickedInTable(app, ~, evt) end % Get name of column which was clicked - thisColumnName = app.UiMetaTableViewer.getColumnNames(thisCol); + [~,thisVarName] = app.UiMetaTableViewer.getColumnNames(thisCol); % Use table variable attributes to check if a double click % callback function exists for the current table column diff --git a/code/apps/+nansen/@MetaTableViewer/MetaTableViewer.m b/code/apps/+nansen/@MetaTableViewer/MetaTableViewer.m index 67df1937..bf8ca939 100644 --- a/code/apps/+nansen/@MetaTableViewer/MetaTableViewer.m +++ b/code/apps/+nansen/@MetaTableViewer/MetaTableViewer.m @@ -524,16 +524,18 @@ function setSelectedEntries(obj, IND, preventCallback) end end - function columnNames = getColumnNames(obj, columnIndices) + function [columnNames,variableNames] = getColumnNames(obj, columnIndices) % getColumnNames - Get name of column(s) given column indices if nargin < 2; columnIndices = []; end - columnNames = obj.ColumnModel.getColumnNames(); + [columnNames,variableNames] = obj.ColumnModel.getColumnNames(); if ~isempty(columnIndices) columnNames = columnNames(columnIndices); + variableNames = variableNames(columnIndices); end if numel(columnNames) == 1 && iscell(columnNames) columnNames = columnNames{1}; + variableNames = variableNames{1}; end end end From 8ef72fec1e8d10af046c61ca3e15a249d2565bce Mon Sep 17 00:00:00 2001 From: Jess Haley Date: Sun, 15 Mar 2026 18:01:38 -0700 Subject: [PATCH 2/2] More updates needed to function --- code/apps/+nansen/@App/App.m | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/code/apps/+nansen/@App/App.m b/code/apps/+nansen/@App/App.m index 6c71dcf7..b6c8e62f 100644 --- a/code/apps/+nansen/@App/App.m +++ b/code/apps/+nansen/@App/App.m @@ -1395,24 +1395,22 @@ function onMouseDoubleClickedInTable(app, ~, evt) end % Get name of column which was clicked - [~,thisVarName] = app.UiMetaTableViewer.getColumnNames(thisCol); + [~,thisVariableName] = app.UiMetaTableViewer.getColumnNames(thisCol); % Use table variable attributes to check if a double click % callback function exists for the current table column TVA = app.getTableVariableAttributes('HasDoubleClickFunction'); - isMatch = strcmp(thisColumnName, {TVA.Name}); + isMatch = strcmp(thisVariableName, {TVA.Name}) & ... + strcmp(app.UiMetaTableViewer.MetaTableType,[TVA.TableType]); if any( isMatch ) - tableVariableFunctionName = TVA(isMatch).RendererFunctionName; + tableVariableFunctionName = TVA(isMatch).DoubleClickFunctionName; if isempty(tableVariableFunctionName); return; end tableRowIdx = app.UiMetaTableViewer.getMetaTableRows(thisRow); % Visible row to data row transformation - tableValue = app.MetaTable.entries{tableRowIdx, thisColumnName}; - tableVariableObj = feval(tableVariableFunctionName, tableValue); - metaObj = app.getMetaObjects( tableRowIdx ); - tableVariableObj.onCellDoubleClick( metaObj ); + feval(tableVariableFunctionName, metaObj); end end