tkinter center window

    def center_window(self, cont, width, height):
        screenwidth = cont.winfo_screenwidth()
        screenheight = cont.winfo_screenheight()
        size = "%sx%s+%s+%s" % (
            width, height, (screenwidth - width) / 2,
            (screenheight - height) / 2)
        return size
posted @ 2017-03-22 10:01  idlewith  阅读(266)  评论(0编辑  收藏  举报