Borrar filtros
Borrar filtros

Is there any way to get the uigetfile panel to be centered in the monitor when it first comes up????

12 visualizaciones (últimos 30 días)
I use the MATLAB function uigetfile to read in the path and name of a file. How do I get that panel to appear in the center of the screen. It always pops up in the upper left corner of the screen.
Note, this code must work with the compiler also.
Thanks Bob
  8 comentarios
Walter Roberson
Walter Roberson el 17 de Mzo. de 2022
Having the functionality work sometime is better than not having it work at all.
However, as you are working with Windows, do not be astonished if it suddenly stops working with some KB*, or if it works differently depending which Creators Edition or half-year Windows update, or whatever.
Matt J
Matt J el 17 de Mzo. de 2022
Editada: Matt J el 17 de Mzo. de 2022
So for now, "Operating-System Dependent Behavior" is best for me. It works.
I'm on a Windows 10 OS and, as I said, the method doesn't work on my machine. I think you will see that if you manually drag the uigetfile window to some random location on the screen and then re-run your code. In Windows, the uigetfile windows will always open where it was last positioned.

Iniciar sesión para comentar.

Respuestas (2)

Walter Roberson
Walter Roberson el 15 de Mzo. de 2022
No, there is no control over that.
If you are not using a deployed app, then MATLAB runs a java method to start an operating-system native file picker. There are no user-level controls over where that operating-system facility will appear.

Matt J
Matt J el 15 de Mzo. de 2022
If you drag the uigetfile window to the location where you want it then, the next time you call uigetfile, it will open in that position, even if it's in a later Matlab session. I don't know if something similar would hold true for a deployed app.

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by