Search code examples
matlabuser-interfacecallbackmatlab-uitable

Uitable set callback to column name


I have a uitable in MATLAB and currently I have callback functions to every cell. I have been trying for a while now to set a callback to the column and row name, but with no success. More specifically if the user clicks on a particular column name, is it possible to call a function?

Please let me know if you need any more info... I would appreciate any help. Thanks in advance!


Solution

  • This seems to be impossible using only the standard MATLAB interface to uitable.

    However, you can access the underlying Java JTable as described on undocumentedmatlab.com. Using the JTable instance you should be able to install an appropriate event handler, see this question on SO and this other article on undocumentedmatlab.com.