简体   繁体   中英

Toplevel widgets in Tkinter

I have a Toplevel widget I'd like it so that it would never appear within the confines of the main Tk window. Basically so that when the Toplevel appears it doesn't cover up any of the main Tk window.

您想使用wm_geometry和一点点数学来计算和设置第二个顶层的合适起始位置。

You could just set up a separate toplevel, cf:

self.newwindow = Toplevel(self)
self.newwindow.title('New Window')

and then embed the widget in the separate toplevel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM