keep focus in command window
Afficher commentaires plus anciens
how can I keep keyboard focus in the command or edit window, even if I create, change or clf a figure?
or to ask another way: how can I prevent figures stealing my focus?
I'm using linux.
thanks
Réponse acceptée
Plus de réponses (1)
Jim Hokanson
le 26 Mai 2020
You could also create a function that does what you want. In response to Walter's answer, I don't want to always work at avoiding calls to figure ... You can call this function at the command line and it will keep focus in the command line
function fig(h)
%
% TODO: Document - replaces figure(h)
if nargin == 0
figure();
else
figure(h);
end
%Not sure what the best option is here but we need
%to wait until some point when Matlab has switched focus to the
%figure before switching back to the command window otherwise due to the
%asynchronous nature we'll "switch" to the command window and then Matlab
%will switch to the figure
drawnow nocallbacks
commandwindow
end
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!