I'm looking for an example or advice for embedding an xterm window in a wxPython panel. I think I can get the window ID of a panel with something like "wid=somePanel.GetHandle()" and I should be able to pass that to "xterm -use wid" but so far I'm not having much luck making that work.
Here is a simple script that does work on my machine (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()
Two things to note are