MATLAB Function Reference Previous page   Next Page
movegui

Move GUI figure to specified location on screen

Syntax

Description

movegui(h,'position') moves the figure identified by handle h to the specified screen location, preserving the figure's size. The position argument can be any of the following strings:

The position argument can also be a two-element vector [h,v], where depending on sign, h specifies the figure's offset from the left or right edge of the screen, and v specifies the figure's offset from the top or bottom of the screen, in pixels. The following table summarizes the possible values.

h (for h >= 0)
offset of left side from left edge of screen
h (for h < 0)
offset of right side from right edge of screen
v (for v >= 0)
offset of bottom edge from bottom of screen
v (for v < 0)
offset of top edge from top of screen

movegui('position') move the callback figure (gcbf) or the current figure (gcf) to the specified position.

movegui(h) moves the figure identified by the handle h to the onscreen position.

movegui moves the callback figure (gcbf) or the current figure (gcf) to the onscreen position. This is useful as a string-based CreateFcn callback for a saved figure. It ensures the figure appears on screen when reloaded, regardless of its saved position.

Examples

This example demonstrates the usefulness of movegui to ensure that saved GUIs appear on screen when reloaded, regardless of the target computer's screen sizes and resolution. It creates a figure off the screen, assigns movegui as its CreateFcn callback, then saves and reloads the figure.

See Also

guide

"Creating GUIs" in the MATLAB documentation


Previous page  movefile movie Next page

© 1994-2005 The MathWorks, Inc.