Matlab - Ejecutar una gui maximizada


Ejecutar una gui maximizada

Publicado por Diego (13 intervenciones) el 10/08/2009 17:51:59
Hola, queria saber si existe alguna forma para poder ejecutar una gui maximizada.

Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil

RE:Ejecutar una gui maximizada

Publicado por fismat (391 intervenciones) el 10/08/2009 19:07:03
Hola Diego,

Creo que la opción es agregar algo de codigo en la funcion "resizefcn" de las propiedades de un figure cuando se activa el marco grafico del gui.


ResizeFcn functional handle,

cell array containing function handle and additional
arguments, or string (not recommended)Window resize callback function. MATLAB executes
the specified callback function whenever you resize the figure window and
also when the figure is created. You can query the figure's Position property
to determine the new size and position of the figure. During execution of
the callback routine, the handle to the figure being resized is accessible
only through the root CallbackObject property,
which you can query using gcbo.You can use ResizeFcn to maintain a GUI layout
that is not directly supported by the MATLAB Position/Units paradigm.For example, consider a GUI layout that maintains an object at a constant
height in pixels and attached to the top of the figure, but always matches
the width of the figure. The following ResizeFcn accomplishes
this; it keeps the uicontrol whose Tag is 'StatusBar' 20 pixels high, as wide as the figure, and attached to the top of the figure.
Note the use of the Tag property to retrieve the uicontrol
handle, and the gcbo function to retrieve
the figure handle. Also note the defensive programming regarding figure Units,
which the callback requires to be in pixels in order to work correctly, but
which the callback also restores to their previous value afterwards.u = findobj('Tag','StatusBar');
fig = gcbo;
old_units = get(fig,'Units');
figpos = get(fig,'Position');
upos = [0, figpos(4) - 20, figpos(3), 20];
set(fig,'Units',old_units);You can change the figure Position from within the ResizeFcn callback;
however, the ResizeFcn is not called again as a result.Note that the print command can cause the ResizeFcn to
be called if the PaperPositionMode property is set to manual and
you have defined a resize function. If you do not want your resize function
called by print, set the PaperPositionMode to auto.See Figure Resize Functions for
an example of how to implement a resize function for a GUI.See Function Handle Callbacks for
information on how to use function handles to define the callback function.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil