Window in Window

Hi,

Is it possible to have a window in the main panda3d window. I mean such a 2d moveable widget in panda. Is that possible?

Yes, it is. Have a look at Display Regions in the manual. There is a written exemple that explain it well.

Can we reparent a second window to the first window, using SetWindowParent or something? Can we get at the native MDI interfaces, or get such a widget in DirectGui?

A DisplayRegion is not actually a different window, it’s just a rectangular region within the first window. You can manipulate it view Panda-specific controls, not via Windows operations.

It is possible, to a limited extent, to create actual separate windows and parent them to each other. But this usually results in suboptimal performance; many graphics cards prefer to render to only one window at a time.

David

That implies that every platform has provisions for reparenting top-level windows to other windows, and preserving their style and controls, including resizability and dragability.

While you would be rendering to the same pixel more than once, you suggest that performance would actually take an additional loss somewhere.

Speaking of which, I observed that a Panda window behind my browser window actually interfered with a ToolTip pop-up that extended beyond the latter’s boundaries. The ToolTip got drawn-over quite soon after it appeared.

Well, it’s more that this is beyond the scope of a 3-D graphics engine like Panda. You’re talking about the sorts of things that a good 2-D engine, like wxWidgets or the like, might provide. But this sort of thing (a) isn’t universally supported by 3-D hardware, and (b) isn’t commonly needed in 3-D applications, so therefore © isn’t usually offered by 3-D engines.

Yes. 3-D hardware is very sensitive to graphics state. Drawing pixels is fast, changing state is slow. Having two (or more) simultaneously open windows requires changing state back and forth repeatedly, which on some drivers–especially for older hardware–is quite expensive. (Modern cards tend to be able to handle this better.)

This is again a driver issue, not necessarily an issue with Panda itself. This is due to the graphics driver not integrating its 3-D window nicely with the rest of the 2-D display. It’s a common problem, especially with older drivers.

David

Is it possible now. I just need a little 2d box, where I can put buttons on and move the box over the screen. The buttons should move with it.
I know how to make buttons and stuff, but is it possible to make such a box/window?

What, all you want is a box with buttons? That sounds like a DirectFrame. See the DirectGui section of the manual.

David

But can I move the box over the screen?

Off course yes, a pos feature exists for all DirectGui objects.
There is a table in the manual explaining all what you can do.

drag and drop of DGUI frames:
discourse.panda3d.org/viewtopic.php?t=4861