Thread Subject: how to show a modal figure in MATLAB (GUI)

Subject: how to show a modal figure in MATLAB (GUI)

From: VijaKhara

Date: 23 Jun, 2007 21:41:40

Message: 1 of 5

HI all

I want that after a user clicks a button on a mother figure a child
figure will show up on the center of the screen. Also what I want is
that the main process will wait until the user completes entering some
parameters through the child figure and closing it, then will continue
its processing. It is similar to what we do with domodal in Visual C+
+.
 In MATLAB assume that the M file of the child figure is CHILD.m, in
CALLBACK function of the button in Mother.m I place the command CHILD
and set the WINDOWSTYLE of the Child figure to Modal. The child
figure shows up but not on the center of the screen and the main
process doesn't wait for user to enter some parameters on CHILD
figures. In stead, it still runs the followed codes.

Please tell me how to do what I want in MATLAB? Also please tell me
how to communicate between two figures?

Thanks

Subject: how to show a modal figure in MATLAB (GUI)

From: VijaKhara

Date: 23 Jun, 2007 22:07:06

Message: 2 of 5

I found that uiwait is the solution, however still don't know how to
place it on the center of the screen. In fact, in the past, I
succeeded in this very simply, did not need to set positions x, y
paras. But now I forget the way/


Thanks

On Jun 23, 11:41 pm, VijaKhara <VijaKh...@gmail.com> wrote:
> HI all
>
> I want that after a user clicks a button on a mother figure a child
> figure will show up on the center of the screen. Also what I want is
> that the main process will wait until the user completes entering some
> parameters through the child figure and closing it, then will continue
> its processing. It is similar to what we do with domodal in Visual C+
> +.
> In MATLAB assume that the M file of the child figure is CHILD.m, in
> CALLBACK function of the button in Mother.m I place the command CHILD
> and set the WINDOWSTYLE of the Child figure to Modal. The child
> figure shows up but not on the center of the screen and the main
> process doesn't wait for user to enter some parameters on CHILD
> figures. In stead, it still runs the followed codes.
>
> Please tell me how to do what I want in MATLAB? Also please tell me
> how to communicate between two figures?
>
> Thanks

Subject: how to show a modal figure in MATLAB (GUI)

From: GUI

Date: 11 Jul, 2007 17:20:53

Message: 3 of 5

I have the same problem. I want to center every form/window I build
with GUI in the screen (like VB6, C#, ... let you specificy:
ScreenCenterOwner|...|... ).
Does anyone know how to do it?
Regards.

 VijaKhara wrote:
>
>
> I found that uiwait is the solution, however still don't know how
> to
> place it on the center of the screen. In fact, in the past, I
> succeeded in this very simply, did not need to set positions x, y
> paras. But now I forget the way/
>
>
> Thanks
>
> On Jun 23, 11:41 pm, VijaKhara <VijaKh...@gmail.com> wrote:
>> HI all
>>
>> I want that after a user clicks a button on a mother figure a
> child
>> figure will show up on the center of the screen. Also what I
want
> is
>> that the main process will wait until the user completes
entering
> some
>> parameters through the child figure and closing it, then will
> continue
>> its processing. It is similar to what we do with domodal in
> Visual C+
>> +.
>> In MATLAB assume that the M file of the child figure is
CHILD.m,
> in
>> CALLBACK function of the button in Mother.m I place the
command
> CHILD
>> and set the WINDOWSTYLE of the Child figure to Modal. The
child
>> figure shows up but not on the center of the screen and the
main
>> process doesn't wait for user to enter some parameters on CHILD
>> figures. In stead, it still runs the followed codes.
>>
>> Please tell me how to do what I want in MATLAB? Also please
tell
> me
>> how to communicate between two figures?
>>
>> Thanks
>
>
>

Subject: how to show a modal figure in MATLAB (GUI)

From: Adam

Date: 11 Sep, 2007 14:44:27

Message: 4 of 5

get(hObject, 'Position')

returns vector [x, y, w, h]

get(0, 'ScreenSize')
    ^^ that's a zero

returns vector [1, 1, wS, hS]
which is the dimensions of the screen

set(hOjbect, 'Position', [(wS-w)/2 (hS-h)/2 w h]) should do it

GUI <ossadas@hotmail.com> wrote in message
<ef5b830.1@webcrossing.raydaftYaTP>...
> I have the same problem. I want to center every
form/window I build
> with GUI in the screen (like VB6, C#, ... let you specificy:
> ScreenCenterOwner|...|... ).
> Does anyone know how to do it?
> Regards.
>
> VijaKhara wrote:
> >
> >

Subject: how to show a modal figure in MATLAB (GUI)

From: Adam

Date: 11 Sep, 2007 14:44:40

Message: 5 of 5

get(hObject, 'Position')

returns vector [x, y, w, h]

get(0, 'ScreenSize')
    ^^ that's a zero

returns vector [1, 1, wS, hS]
which is the dimensions of the screen

set(hOjbect, 'Position', [(wS-w)/2 (hS-h)/2 w h]) should do it

GUI <ossadas@hotmail.com> wrote in message
<ef5b830.1@webcrossing.raydaftYaTP>...
> I have the same problem. I want to center every
form/window I build
> with GUI in the screen (like VB6, C#, ... let you specificy:
> ScreenCenterOwner|...|... ).
> Does anyone know how to do it?
> Regards.
>
> VijaKhara wrote:
> >
> >

Tags for this Thread

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.

rssFeed for this Thread

Contact us at files@mathworks.com