[Tkinter-discuss] Control position of Tkinter common dialogs?
ozgulfirat at gmail.com
Tue Oct 26 12:05:34 CEST 2010
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"
2010/10/25 <python at 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
> * All common dialogs appear to ignore the optional parent=
> * How can we force a dialog to open up relative to its parent
> * How can we force a dialog to open up centered on the user's
> 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()
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tkinter-discuss