Borrar filtros
Borrar filtros

How to position a GUI centered on the desktop

5 visualizaciones (últimos 30 días)
Calabrese
Calabrese el 26 de Ag. de 2015
Comentada: Adam el 27 de Ag. de 2015
I am trying to center my GUI on the desktop but I am not sure where in the code I put the command
I am using
movegui('center') and movegui(IAM,'center')
Not sure if both would work the same but where in my code does the command go so when every time I open it, it will be positioned center on the screen.

Respuesta aceptada

Adam
Adam el 26 de Ag. de 2015
Where to put it exactly depends whether you are using a GUIDE GUI or a programmatic one.
I forgot the function exists so I position my UIs manually, but the examples seem to suggest you just put it straight after you create the figure. And if you want you can create the figure off-screen initially so that you don't get a jumping effect of it moving from one on-screen location to another.
In a GUIDE GUI I would think the OutputFcn should work as a place to put it. I'm not sure about the OpeningFcn since the figure doesn't exist until that function has completed.
  2 comentarios
Calabrese
Calabrese el 26 de Ag. de 2015
I am using GUIDE and it works perfectly under both options. Thank You
When I run the code that opens it, it will recognize it. Also when I call that GUI from another GUI it recognizes it
Only issue now it when I open just the figure from the folder directory it doesn't recognize a centered position. Its not the worst thing but still would like to solve that if you have any ideas
Adam
Adam el 27 de Ag. de 2015
As far as I am aware opening the figure from the folder directory will literally just load it as if it were a saved figure. It will have no functionality underneath it and hence will not call the OpeningFcn when it opens. I'm not sure what usefulness opening it this way has though.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by