Thread Subject: Positioning a GUI

Subject: Positioning a GUI

From: Thorarin Bjarnason

Date: 4 Jul, 2008 16:30:06

Message: 1 of 5

Hello:

I have a gui created using guide. I would like this gui to
launch in the upper left corner of the screen.

I tried using 'movegui', but I can only get it to work after
the gui has become viewable <ie it does not work within the
GUI_OpeningFunction(...) area>, causing it to jump to the
new location.

Suggestions?

Subject: Positioning a GUI

From: Aleks

Date: 4 Jul, 2008 23:21:02

Message: 2 of 5

"Thorarin Bjarnason" <thor4ooo@gmail.com> wrote in message
<g4lj6e$b6a$1@fred.mathworks.com>...
> Hello:
>
> I have a gui created using guide. I would like this gui to
> launch in the upper left corner of the screen.
>
> I tried using 'movegui', but I can only get it to work after
> the gui has become viewable <ie it does not work within the
> GUI_OpeningFunction(...) area>, causing it to jump to the
> new location.
>
> Suggestions?
It's a UI Panel property called "Position". It looks like this:
"rect = [left, bottom, width, height]
where left and bottom define the distance from the lower
left corner of the screen to the lower left corner of the
figure window. width and height define the dimensions of the
window. See the Units property for information on the units
used in this specification. The left and bottom elements can
be negative on systems that have more than one monitor." <--
I copied and pasted this for you.

You can get real fancy by normalizing all your figures
depending on the size of the monitor user has :). Search
help files for the "The Position Vector"

Aleks

Subject: Positioning a GUI

From: Vihang Patil

Date: 5 Jul, 2008 08:30:04

Message: 3 of 5

"Thorarin Bjarnason" <thor4ooo@gmail.com> wrote in message
<g4lj6e$b6a$1@fred.mathworks.com>...
> Hello:
>
> I have a gui created using guide. I would like this gui
to
> launch in the upper left corner of the screen.
>
> I tried using 'movegui', but I can only get it to work
after
> the gui has become viewable <ie it does not work within
the
> GUI_OpeningFunction(...) area>, causing it to jump to the
> new location.
>
> Suggestions?
 Lauch your main gui (say main_gui)through other m
function say calling_fcn and do the following
example:

function calling_fcn
h = main_gui;
movegui(h,'northwest');


HTH
Vihang



Subject: Positioning a GUI

From: matt dash

Date: 5 Jul, 2008 15:26:01

Message: 4 of 5

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<g4nbec$oi7$1@fred.mathworks.com>...
> "Thorarin Bjarnason" <thor4ooo@gmail.com> wrote in message
> <g4lj6e$b6a$1@fred.mathworks.com>...
> > Hello:
> >
> > I have a gui created using guide. I would like this gui
> to
> > launch in the upper left corner of the screen.
> >
> > I tried using 'movegui', but I can only get it to work
> after
> > the gui has become viewable <ie it does not work within
> the
> > GUI_OpeningFunction(...) area>, causing it to jump to the
> > new location.
> >
> > Suggestions?
> Lauch your main gui (say main_gui)through other m
> function say calling_fcn and do the following
> example:
>
> function calling_fcn
> h = main_gui;
> movegui(h,'northwest');
>
>
> HTH
> Vihang
>
>
>

This is a very commmon question. See last post here for
example:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/161654#408756

If GUIDE finds your gui is too close to the edge, it will
reposition it UNLESS you have defined a layout function. The
layout function just needs to open the fig file, then you
can reposition the figure anywhere you want. (Either in the
openingfcn, the layoutfcn, or saved in the figure itself.)







Subject: Positioning a GUI

From: Thorarin Bjarnason

Date: 16 Jul, 2008 18:58:02

Message: 5 of 5

Aleks:

Thanks. That was exactly what I was looking for.

Have a nice day,

Tags for this Thread

Everyone's Tags:

gui

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
gui Thorarin Bjarnason 4 Jul, 2008 12:35:04
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com