views:

21

answers:

0

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()

Thank you, Malcolm