For windows message box you cannot. It appears in the center of the screen, and thatβs it. However, the file selection dialog and the color selection are system dialogs that were provided with the Tk chip so that users can see the stock dialogs on this platform. If you set the -parent option, it will be passed to the wrapped windows and it will be centered at your assigned level.
In Tk:
toplevel .t tk_chooseColor -parent .t
As you turn this into Tkinter, I am leaving for someone with Python experience.
As for their centering, the hwndOwner member of the CHOOSECOLOR structure is always set to HWND for one of your Tk levels. To allow it to be born against the desktop, you need to pass NULL, and Tk does not allow you. You can specify the unix version (lib / clrpick.tcl) and show it, but instead it will look strange on the Windows desktop.
patthoyts
source share