[wxPython] Way to center wxFileDialog?

Hi,

I have a wxFileDialog that I would like centered on the screen, but none of
the normal window movement or positioning methods seem to work. Instead it
is always positioned in the upper left corner of the parent. Is there anyway
to center it?

Thanks,
Dan

···

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Well, I figured out a way to do it by controlling the position of a hidden
parent frame, but it seems there should be an easier way. Is there?

Thanks,
Dan

···

----- Original Message -----
From: "Dan Rolander" <dan.rolander@marriott.com>
To: <wxpython-users@lists.sourceforge.net>
Sent: Monday, January 29, 2001 7:24 AM
Subject: [wxPython] Way to center wxFileDialog?

Hi,

I have a wxFileDialog that I would like centered on the screen, but none

of

the normal window movement or positioning methods seem to work. Instead it
is always positioned in the upper left corner of the parent. Is there

anyway

to center it?

Thanks,
Dan

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Try something like:

dlg = wxFileDialog(<your args here>)
dlg.CenterOnScreen()
dlg.ShowModal()
dlg.Destroy()

-Dave

···

I have a wxFileDialog that I would like centered on the screen,
but none of
the normal window movement or positioning methods seem to work. Instead it
is always positioned in the upper left corner of the parent. Is
there anyway
to center it?

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

I have a wxFileDialog that I would like centered on the screen, but none of
the normal window movement or positioning methods seem to work. Instead it
is always positioned in the upper left corner of the parent. Is there anyway
to center it?

I assume you are talking about MSW. If so then the wxFileDialog is just a thin wrapper about the Windows Common Dialog, which really means that it is wrapping the win32 APIs GetSaveFileName and GetOpenFileName. There is no real window handle that we can send the move or size messages to, the APIs are called in the ShowModal method.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

I tried that Dave. It doesn't work.

Thanks.

···

----- Original Message -----
From: "Dave Brueck" <dbrueck@edgix.com>
To: <wxpython-users@lists.sourceforge.net>
Sent: Monday, January 29, 2001 11:43 AM
Subject: RE: [wxPython] Way to center wxFileDialog?

Try something like:

dlg = wxFileDialog(<your args here>)
dlg.CenterOnScreen()
dlg.ShowModal()
dlg.Destroy()

-Dave

> I have a wxFileDialog that I would like centered on the screen,
> but none of
> the normal window movement or positioning methods seem to work. Instead

it

> is always positioned in the upper left corner of the parent. Is
> there anyway
> to center it?

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Thanks Robin. Yeah I just checked the API calls and you're right (of
course!). I also tested some other Windows apps and that does seem to be the
normal behavior (upper left corner of parent). Oh well. Like I said before,
I've got a workaround.

Dan

···

----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@lists.sourceforge.net>
Sent: Monday, January 29, 2001 12:45 PM
Subject: Re: [wxPython] Way to center wxFileDialog?

I have a wxFileDialog that I would like centered on the screen, but none

of

the normal window movement or positioning methods seem to work. Instead it
is always positioned in the upper left corner of the parent. Is there

anyway

to center it?

I assume you are talking about MSW. If so then the wxFileDialog is just a
thin wrapper about the Windows Common Dialog, which really means that it is
wrapping the win32 APIs GetSaveFileName and GetOpenFileName. There is no
real window handle that we can send the move or size messages to, the APIs
are called in the ShowModal method.

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Yeah, sorry about that. It works with other dialogs, of course, but not the
one you want.

And _that's_ why we all wait eagerly for posts from Robin! <g>

-Dave

···

> Try something like:
>
> dlg = wxFileDialog(<your args here>)
> dlg.CenterOnScreen()
> dlg.ShowModal()
> dlg.Destroy()
>
> -Dave

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users