我正在寻找一个在wxPython面板中嵌入xterm窗口的示例或建议。我想我可以获得一个类似“wid = somePanel.GetHandle()”的面板的窗口ID,我应该能够将它传递给“xterm -use wid”,但到目前为止我运气不好工作
答案 0 :(得分:1)
这是一个在我的机器上运行的简单脚本(ubuntu 8 / python 2.5.2 / wxpython2.8.10)
import wx
import os
def bindXterm(win):
winID = win.GetHandle()
print "binding xterm to window %d(%x)"%(winID,winID)
os.system("xterm -inot %d"%winID)
app = wx.PySimpleApp()
xtermFrame = wx.Frame(None)
xtermPanel = wx.Panel(xtermFrame)
xtermPanel.SetBackgroundColour((255,0,0))
app.SetTopWindow(xtermFrame)
xtermFrame.Show()
wx.CallLater(1000, bindXterm, xtermPanel)
app.MainLoop()
需要注意的两件事是