Hello,

I do not know whether there is an easier way to accomplish what you want,
but maybe you can create a new toplevel window in the middle of the screen,
then make it invisible and position the dialog windows relative to this new
toplevel... Like this: http://paste-it.net/public/q2a5594/

I know, this is not nice. Maybe someone else will offer a more "palatable"
alternative.

Firat

2010/10/25 <pyt...@bdurham.com>

> Python 2.7 under Windows: How can we control the position of
> Tkinter's common dialogs?
>
> Here's what we've discovered:
>
>  * Certain common dialogs always open up relative to their
>    parent window
>
>  * Certain common dialogs always open up centered on the user's
>    desktop
>
>  * All common dialogs appear to ignore the optional parent=
>    parameter
>
> Questions:
>
>  * How can we force a dialog to open up relative to its parent
>    window?
>
>  * How can we force a dialog to open up centered on the user's
>    desktop?
>
> Background:
>
> import tkColorChooser as colorchooser
> import tkFileDialog as filedialog
> import tkMessageBox as messagebox
>
> # always open up relative to parent windows
> fileOpen   = filedialog.askopenfilename()
> fileOpens  = filedialog.askopenfilenames()
> fileSaveAs = filedialog.asksaveasfilename()
> color      = colorchooser.askcolor()
>
> # always open up centered on desktop
> folderOpen = filedialog.askdirectory()
> messagebox.askquestion()
>
> Malcolm
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss@python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to