Unable to get uifigure to focus programmatically
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a uifigure with a menu bar (Matlab 2020b). When I click on the menu bar, the uifigure looses focus. I have a uifigure windowKeyPress callback which requires the uifigure to be in focus to work. At the moment after selecting the menu bar, I have to click on the uifigure to make it regain focus. I would like to regain the figure focus programmatically without having to click within the uifigure. I have tried:
figure(hUIFigure)
However, this does not work.
0 comentarios
Respuestas (1)
Shadaab Siddiqie
el 4 de Mzo. de 2021
Editada: Shadaab Siddiqie
el 4 de Mzo. de 2021
From my understanding uifigure is loosing focus. Here is a potential work arounds:
%==== OPTION 1 ====
figure(app.UIFigure);
%==== OPTION 2 ====
app.UIFigure.Visible = 'off';
app.UIFigure.Visible = 'on';
This issue occurs because the MATLAB Window is created as a separate process.
0 comentarios
Ver también
Categorías
Más información sobre Develop uifigure-Based Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!