How will the built-in xterm tk size be dynamic?

You can write a simple python script to insert xterm into the tk frame:

 from Tkinter import * import subprocess root = Tk() termf = Frame(root, height=800, width=1000) termf.pack(fill=BOTH, expand=YES) wid = termf.winfo_id() 

After installing the window

 proc = subprocess.Popen('xterm -into %d -sb ' % wid,shell=True) root.mainloop() 

On my computer it looks embedded xterm How to make embedded xterm dynamically dimension termf frame termf even when changing frame size (by dragging the corner)?

+5
source share
1 answer

As mentioned in the comments above, you can use .bind() in the Tk() window to get a callback every time you configure the window.

 from tkinter import * root = Tk() def callback(event): print(event.width, event.height) root.bind("<Configure>", callback) root.mainloop() 

I have no way to check how you can use this to resize the xterm window in Windows 10. Therefore, I will leave this answer to everyone who wants to edit it, or use this answer to create my own.

0
source

Source: https://habr.com/ru/post/1259074/


All Articles