problem to use "UIFigureCloseRequest"

% Close request function: UIFigure
function UIFigureCloseRequest(app, event)
app.InstrumTab=app.UITable.Data;
Instrum_Tab=app.InstrumTab;
g=app.Setting.Instrument;
save(g,"Instrum_Tab");
delete(app)
end
Warning: Error occurred while executing the listener callback for event Custom defined for class matlabshared.asyncio.internal.Channel:
Error using PredatorManageInstrument/UIFigureCloseRequest
Dot indexing is not supported for variables of this type.
> In matlabshared.asyncio.internal/Channel/onCustomEvent (line 538)
In matlabshared.asyncio.internal.Channel>@(source,data)obj.onCustomEvent(data.Type,data.Data) (line 442)
>>

Respuestas (1)

Walter Roberson
Walter Roberson el 18 de Ag. de 2023

0 votos

The first parameter passed to a UI Figure Close Request Fcn callback is not the app: it is the handle of the component that requested the callback (so, typically the handle of the uifigure)
Unless, that is, you configured the callback as an anonymous function that substitutes app for the normal first parameter.

5 comentarios

piero
piero el 18 de Ag. de 2023
Editada: piero el 18 de Ag. de 2023
i click with taste dx on tab..but i dont see it
i want to save data whn i close tab
Walter Roberson
Walter Roberson el 18 de Ag. de 2023
CellSelection callbacks are for uitable(), so you are not clicking on a uifigure, you are clicking on a uitable. There is no close request callbacks for uitable . You need to click somewhere in the uifigure that is outside of the uitable in order to be able to set the callback.
piero
piero el 18 de Ag. de 2023
i find it:
but it link my precedence code
piero
piero el 19 de Ag. de 2023
Editada: piero el 19 de Ag. de 2023
the app is correct...it's information about my tab (34*19 it's my tab)
(i tried to change below something in the code but result doesn't change)
Walter Roberson
Walter Roberson el 19 de Ag. de 2023
Notice that app.Setting is [] but you are trying to access app.Setting.Instrument

Iniciar sesión para comentar.

Categorías

Más información sobre Develop Apps Using App Designer en Centro de ayuda y File Exchange.

Preguntada:

el 18 de Ag. de 2023

Comentada:

el 19 de Ag. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by