Can we specify or make uigetfile() remember its window position or view mode/sorting?
51 ビュー (過去 30 日間)
古いコメントを表示
I've always avoided using uigetfile() because of how cumbersome it is and because it doesn't adhere to any of my system preferences that affect file management dialogs in other applications. It never remembers what the last path was or how the window was configured.
I've managed to implement a workaround for making the path persistent, but I'm struggling to figure out any acceptable way of managing the window size, view mode, and sorting behavior without manually mousing every single time.
I could probably resort to doing some sort of bash script with xdotool and wmctrl that waits for the dialog to appear, but I want to know if there's something at least a little less ridiculous, but less involved than reimplementing the whole thing. I'm open to undocumented solutions, as I'm probably going to be the only one using it. Web searches haven't turned up anything, but I figured I'd ask.
2 件のコメント
Walter Roberson
2025 年 11 月 17 日 21:19
There might possibly have been some mechanism in R2019b (which you noted as your release), but by R2025a there is no hope.
回答 (2 件)
Matt J
2025 年 11 月 17 日 23:14
編集済み: Matt J
2025 年 11 月 18 日 0:22
This file exchange submission seems to do most of the above,
The last position of the dialog is remembered automatically, and the FilterSpec option can beused ot specify the initial folder path.
6 件のコメント
Matt J
2025 年 11 月 18 日 3:59
編集済み: Matt J
2025 年 11 月 18 日 4:03
That doesn't stop me from programmatically building a UI, but it's probably less convenient than intended.
Since you have R2019b, you still have GUIDE. I wonder if the text field issue affects that as well. If not, that would give you a better GUI-building alternative than purely programmatic GUI construction.
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!