[Tkinter-discuss] Dialog as transient above current toplevel

Michael Lange klappnase at web.de
Wed Aug 24 18:54:35 EDT 2016


Hi,

On Wed, 24 Aug 2016 13:01:01 +0000
Vasilis Vlachoudis <Vasilis.Vlachoudis at cern.ch> wrote:

> However the displayed dialog is centred over the desktop and not above
> the running application, which is rather confusing.
> Is there a way to center it over my toplevel window?

unfortunately this geometry is hard-coded into Tk, so the answer is "no".

You might want to try the tkSimpleDialog.Dialog class instead, by default
these dialogs are placed somewhere into the upper left corner of the
parent, however you would have to set up a messagebox-like dialog
yourself, there is no convenience function for message boxes included.

If using pmw is an option for you, you might also try the Pmw.Dialog ,
iirc there's an option to center the dialog onto its parent.

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Madness has no purpose.  Or reason.  But it may have a goal.
		-- Spock, "The Alternative Factor", stardate 3088.7


More information about the Tkinter-discuss mailing list