Remove window border and create custom window title

Hello, I know it’s possible to remove the window’s border and window title.
But i want to create my custom window title bar like google chrome for example or MS office, it’s possible with use only panda3d ?

i want this for example:
image
I want to be able to move the window from this custom bar when i click with mouse on the blue zone

What you’re looking for is known as client-side decorations, and Panda3D has nothing built in for this. There may be a way to fake things, but it will likely require OS-specific code.

If you don’t require that the custom title-bar differ from OS to OS, then you might be able to do it something like so:

  • Have the window be generated without decorations
  • Depict your own title bar using Panda elements (perhaps via DirectGUI)
  • Use mouse-events to detect attempts to drag the window, and then set the window’s position accordingly.

There are likely some pitfalls in doing so, however. For example, I seem to recall that Panda stops sending mouse-events when the mouse exits the window, meaning that too fast a drag might result in the window no longer responding until the mouse re-enters it. I’m also not sure of quite how the Panda window will behave if you attempt to place it in this manner.

Still, it may be worth trying!

Maybe I’m missing something, but isn’t client-side decorations just effectively what @Thaumaturge pointed out, namely, creating an undecorated window and drawing the chrome inside the application?

You can adjust the frame on the DisplayRegion to resize the part of the window that the scene is rendering into, to make sure your window chrome doesn’t overlap your scene.