You really have three choices.
One easy way would be to use the tcl/tk stuff that other panda panels use. For example, take a look at the particle panel sample program. The downside is that the rendering would still be in a separate window.
A second easy way would be to use panda’s built-in widgets. But the downside here is that the built-in widgets are a little primitive.
If neither of those appeals, then you have to go the difficult route. Here’s a rough outline. First, find a widget set that’s well-integrated with python - say, tcl/tk or pyGtk. Use that to create your main window, before you initialize panda.
Then, modify the code that initializes the panda window. In showbase.py, you’ll find this code:
if type == 'onscreen':
win = self.graphicsEngine.makeWindow(gsg, name, 0)
elif type == 'offscreen':
win = self.graphicsEngine.makeBuffer(
gsg, name, 0, props.getXSize(), props.getYSize(), 0)
This is where it creates the window. It is not picky about where it renders to — it can render to an opengl window, a directx window, an onscreen window, an offscreen buffer, to no window at all. It seems to me that it would probably not be hard to add another option - render to an already-existing subwindow of a tcl/tk or pygtk application. This may involve doing some C++ hacking, though. In the source tree, in the subdirectory panda/src/windisplay, is the code that creates a window from scratch. It may be necessary to add another, similar module that creates a window within an existing application.
Frankly, all this sounds like a lot of work to me. I actually think it would be easier to use panda’s built-in widgets, despite their limitations.