Hi all,
A great feature from mplayer is the capability of drawing the played
movie in a window from another process using the -wid window_id
parameter. In the software I help to develop we want to do something
like that, a raycasting rendering from process A being drawing in the
process B using wxPython. Is it possible?
On Windows it might be doable. wx.Window_FromHWND(None, handle) can
wrap a wx.Window around an existing window handle, so you can then bind
paint events for it, etc. On the other platforms it will just raise an
exception. If anybody would like to figure out how to do something like
that for the other platforms I would love to get some patches submitted
for it.
Thanks Robin! You have some example?
No.
Ok. Here we’ll try to do that and post a example here.
Hi Robin,
We made a small example, but have 2 questions.
When you run the second process (1.py) is added to the panel frame of the first process (0.py), but it quickly disappears, the MainLoop () terminates immediately.
The second question is, wxPython has some “special” way of making two applications to communicate? so for me to pass the id of the first application for the second.
The code:
#==================== 0.py ==================================
import wx
class Jan(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "Test", wx.DefaultPosition, wx.Size(800,600))
pnl = wx.Panel(self)
handle = int(pnl.GetHandle())
f = open("handle.conf", "w")
f.write(str(handle))
f.close()
class Programa1(wx.App):
def OnInit(self):
jan = Jan()
jan.Show()
return True
prog = Programa1(0)
prog.MainLoop()
#================ 1.py =======================================
import wx
class Jan2(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
self.SetBackgroundColour((0,0,255))
self.SetSize(wx.Size(500,500))
class Programa2(wx.App):
def OnInit(self):
f = open("handle.conf", "r")
a = int(f.readline())
f.close()
w = wx.Window_FromHWND(None, a)
jan2 = Jan2(w)
jan2.Show()
return True
prog2 = Programa2(0)
prog2.MainLoop()
Thx,
Paulo Amorim
···
On 22 October 2010 15:36, tfmoraes totonixsame@gmail.com wrote:
On 22 out, 15:29, Robin Dunn ro...@alldunn.com wrote:
On 10/22/10 9:28 AM, tfmoraes wrote:
On 21 out, 15:07, Robin Dunnro...@alldunn.com wrote:
On 10/21/10 5:34 AM, Thiago Franco Moraes wrote:
–
Robin Dunn
Software Craftsmanhttp://wxPython.org
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en