Function of the toolbar-cross

1 次查看(过去 30 天)
Hey everyone, does anyone know how/where to edit a GUI's closing function (if there even is one)? I'm not talking about commands like close but the X-button in the top right corner of the window. By hitting the X-button I want my GUI to call a certain function. Any ideas?

采纳的回答

Sean de Wolski
Sean de Wolski 2014-2-4
编辑:Sean de Wolski 2014-2-4
This does execute the CloseRequestFcn of the figure:
function exampleCloseReq
figure('CloseRequestFcn',@closeme)
function closeme(src,evt);
disp('I''m closing');
delete(src)
Save this as exampleCloseReq.m

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by