Center new windows

Anand B Pillai abpillai at lycos.com
Wed Mar 26 07:52:25 EST 2003


I guess the doubt cannot be on wxPython, because the
method there is straight forward.

window.CentreOnScreen() will center your window on screen
window.CentreOnParent() will center your window on its parent
(Generic)window.Center() will center the window to its immediate top-level
window. If this window is the top-level window, then it will be same
as window.CentreOnScreen().

Regards

Anand Pillai

Abel Daniel <abli at freemail.hu> wrote in message news:<mailman.1048630420.7469.python-list at python.org>...
> richard.a.charts.1 wrote:
> > Hi,
> > I have a fairly quick question that I haven't been able find the answer
> > for.  When opening a new window, how can I force it to open in the center
> > of the screen?
> > 
> > I have searched through old messages but most are over 2 years old and I
> > am wondering if there has been changes for the better?
> If you mean the ones returned by google groups when searching for
> -tkinter center screen- then I guess there isn't anything easier. (at
> least i didn't hear of one, not that this means anything :) )
> 
> > On a small side note:
> > How does geometry work with a given widget?  Whenever I try to use it,
> > Python says that some class has no instance of geometry or withdraw or
> > others for that matter.
> To me it looked like only instances of Toplevel have the methods you
> mention. Those methods deal with displaying windows, so they don't
> really make sense for a Listbox widget, for example.
> 
> Abel Daniel




More information about the Python-list mailing list