Change Panda3D Window Title?

Hey,

Is there a way to change the window title of the Panda Window?

Thanks.

Yes, there is:

from pandac.PandaModules import WindowProperties

props = WindowProperties( )
props.setTitle( 'My window' )
base.win.requestProperties( props )

enn0x

3 Likes

Thanks! :wink:
I’ll try it this week. (I formatted my PC so it takes a while to install everything, including panda :stuck_out_tongue: )

Also … edit your C:\Panda3D-1.3.2\etc\Config.prc and add a line like this:

window-title My Title Goes Here

Doing it in the etc\Config.prc file will change the default window title for all Panda3D apps. You can override this on a per-project basis by having another .prc file loaded at runtime or by the code above.

Is there also a way to change the window’s icon?

I think there is in windows but not in linux. I think I saw this in another thread a while back. Try searching the forums … I will too …

Here is one way to do it … can’t find the thread that discusses it not working in linux.

discourse.panda3d.org/viewtopic.php … light=icon

Thank you for the quick reply.

However, it doesn’t work. I still get the default X icon.

Linux? If so I think you are outta luck …

Maybe a nice feature for Panda3D 1.4.0? :wink:

1 Like

Hi,

I know this is for a long time ago, but I’m using linux and icons still are not working here. Is there a plan to add support for icon files on linux?

This is the tracking issue for this feature:

There is a WIP pull request by @eldee to address this:

If someone else wants to take over the work they are welcome to.

2 Likes

A complete script if you are interested:

from direct.showbase.ShowBase import ShowBase
from pandac.PandaModules import WindowProperties

"""
Minimal template for a panda3d window
"""

class MyApp(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)

        base.setBackgroundColor(0, 0, 0)
        props = WindowProperties()
        props.setTitle('Your Window Title Goes Here')
        self.win.requestProperties(props)

if __name__ == "__main__":
    app = MyApp()
    app.run()