Disable screen resize on windowed mode...

Hi, I’m trying to disable window resizing on windowed mode. I searched Window Properties for the proper command but no luck so far. My current workaround is putting…

wp = WindowProperties()
wp.setSize(660, 600)
base.win.requestProperties(wp)

on a continous task but it’s a bit overkill. Any tips on a better way to do this?

Try:

wp.setFixedSize(True)

David

Hmm… It still doesn’t work, I can still resize the window by dragging the corners. I’m running Panda3D on windows XP by the way… Should I put

        wp = WindowProperties()
        wp.setFixedSize(True)
        wp.setSize(660, 600)
        base.win.requestProperties(wp)

on a task or calling it once should be enough? I just added that code on the init of the main class.

The resizability of a window might be one of those properties that you can only specify on window creation. Pass this WindowProperties in to the createWindow() call. If you are using the default window, you’ll have to turn this off and open your own window by hand. Or, you can put:

undecorated 1

in your config.prc file, which does a little bit more than making it nonresizable, but it might suit your needs if you don’t want mind having no window decoration at all.

David

Thanks, the window was unresizable now. But there’s no title bar and I can’t even open the right-click menu on the taskbar, but I’ll find a workaround. Thanks again… :smiley:

Hi, kind of late for an answer to dammerung, but for anyone interested for an answer, the correct way to do it is:

from panda3d.core import *
loadPrcFileData('', 'win-fixed-size 1')

so you need to do it before you load anything else.
check drwr’s answer

1 Like