panda + wxpython + linux

So is having a panda3d window on a wxpython panel not possible in linux? The posts I found that said no were somewhat old so I was hoping it was possible now.

nomb

its possible but there is vertically no reason for it. It will be also hard to keep code cross platform. Wx does not give any thing to panda just cases more headache.

I’m not sure that’s true–I can think of a few good reasons to bind a Panda window to a wxPython parent. It may or may not be difficult to maintain; I don’t know, but I don’t really think it would be.

But, I haven’t done the work for this, because I don’t personally need it right now, and I do have some more important things to work on instead. As always, of course, patches are welcome, if anyone else would like to do the work necessary. All you’d need to do would be to find a way to expose the low-level window handle in wxPython, and add the appropriate interfaces to glxGraphicsWindow to respect WindowProperties::set_parent_window().

David

I just implemented it and checked it into CVS. Here is diff:
panda3d.cvs.sourceforge.net/pand … 81&r2=1.82

The X window ID can be retrieved by calling GetHandle() on the wxFrame or wxWindow.
One important note: you have to call Update() on your wxWindow first before you do GetHandle(), otherwise it might happen that your window is not created yet, in that case GetHandle() will return 0.

Wow, that rocks! Thanks!

David

Will this technique also work under Windows?

It already works under Windows, I’ve already been using it for a long time on windows. It should work on Mac as well, I think.

Finally someone did it.
But calling Update() doesn’t help. Calling Dispatch() on the custom event loop while Pending() did it.

I just checked in this fix for tinyXGraphicsWindow as well, if you don’t mind.

Ah, excellent. Thanks!

David