I have a modal guide gui with bunch of editable edit boxes. everything works out except for when I attempt to close the gui immediately after entering a new input (with keyboard) in any one of the edit boxes. It's like the changes is not effective unless I click somewhere on the gui's figure before closing it.
Any help is appreciated
No products are associated with this question.
There is a problem with the edit box, I show a solution here: http://www.mathworks.in/matlabcentral/answers/33136#answer_41732
And this thread explains the behaviour of the MATLAB's edit box: http://www.mathworks.com/matlabcentral/newsreader/view_thread/151905
No, unfortunately it doesn't work even if I try to give focus to the figure. This is the script (it works in debugging mode but to no use)
function out = mygui
% Create a simple guy with one editbox h.f = figure('toolbar','none','menubar','none'); h.e = uicontrol('Style','edit','units','pix','position',[100 100 200,20]);
% Set CloseRequestFcn set(h.f, 'CloseRequestFcn',@f_crf)
% Set into wait so that we can assign out uiwait(h.f)
% Assign out IF resumed out = h.out;
% Close gui delete(h.f)
function f_crf(varargin) % Force focus to figure set(h.e,'Visible','off') drawnow set(h.e,'Visible','on')
% Retrieve string h.out = get(h.e,'string');
% Resume uiresume(h.f) end