[Tkinter-discuss] Control position of Tkinter common dialogs?

gerard.roger.laine at free.fr gerard.roger.laine at free.fr
Wed Dec 7 20:36:00 EST 2016


All common dialogs appear to ignore the optional parent = parameter 

It seems it is because your code invoke the winfo_root() before the grid
manager finish is calculations.
and this command return a Null decimal string.

According to Tk manual "https://www.tcl.tk/man/tcl8.4/TkCmd/winfo.htm#M52" 

If you need the true width immediately after creating a widget, invoke
update to force the geometry manager to arrange it, or use winfo reqwidth to
get the window's requested width instead of its actual width.

This code works perfectly

self.update()

self.geometry("+%d+%d" % (self.parent.winfo_rootx()+50,
self.parent.winfo_rooty()+50 ) )




--
View this message in context: http://python.6.x6.nabble.com/Control-position-of-Tkinter-common-dialogs-tp1978712p5204895.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.


More information about the Tkinter-discuss mailing list