How do I control where focus goes after uigetfile dialog is dismissed

6 ビュー (過去 30 日間)
Curtis Gehman
Curtis Gehman 2016 年 4 月 20 日
回答済み: Adam Danz 2025 年 7 月 11 日
In a button callback function, I'm calling uigetfile to have the user select a file. When that file selection dialog is dismissed, focus switches over to my main Matlab window instead of back to my "app". Looks like uicontrol(c) works with the old uicontrol widgets. But I'm using App Designer, which uses a different collection of OO widgets, and uicontrol(c) does not work with them. I have a specific EditField to which I'd like to pass focus. Is the a way to set focus to the EditField before I return from the callback? How? Working in Matlab 2016a.
  2 件のコメント
Dmitry
Dmitry 2016 年 10 月 11 日
I am having the same problem with uisetcolor in Matlab 2016b.
Have you figured out a workaround?
acegi bdegi
acegi bdegi 2017 年 11 月 8 日
bump

サインインしてコメントする。

回答 (1 件)

Adam Danz
Adam Danz 2025 年 7 月 11 日
This has been fixed in R2025a. Focus now returns to the app that called uigetfile or uisetcolor after the dialog is closed. The fix is also available in the R2024a and R2024b beta releases only (not the R2024a and R2024b general releases).

カテゴリ

Help Center および File ExchangeApp Building についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by