Use Tkinter to create GUI development tools (36) Multi-child window components in Tkinter

Use Tkinter to create GUI development tools (36) Multi-child window components
in Tkinter We have introduced Tkinter as a very good GUI library. Although this GUI library was born in 1991, it is an excellent graphical interface under Unix and has now been ported to Linux. , MacOSX, and Windows systems.
We can understand Tkinter as a "C language" functional graphic interface, and use Python's class functions to encapsulate Tkinter as a "C++ language" graphic interface. We have introduced many graphical modules after Tkinter encapsulation, such as Tkinter skin module, Tkinter bubble prompt, ttk.Notebook component imitation of Tkinter and so on. Similarly, we encapsulate a multi-window MDIwindows component in HP_tk2.
The program demo code is given below:

import  tkinter  as  tk   #导入Tkinter
import HP_tk2 as htk

if __name__=="__main__":
    root=tk.Tk()
    root.title('多子窗口演示') 
    root.geometry('{}x{}+{}+{}'.format(800, 600, 100, 200))
    mw=htk.MDIwindows(root)
    w1=mw.newwindow(title='子窗口1')
    w2=mw.newwindow(title='子窗口2')
    root.mainloop()

The program demonstration pictures are as follows:
Insert picture description here

Guess you like

Origin blog.csdn.net/hepu8/article/details/106323782