ConfigVariable for disabling window resizing?

How do you disable window resizing?

I don’t see it in the documentation, but is there a CongifVariable to disable window resizing?

Right now I’ve got the window loading at a specific size and I want to keep it that way.

win-fixed-size 1

Didn’t work.

I’ve tried the following with no luck:

ConfigVariableString("win-fixed-size", "0").setValue("1")
ConfigVariableString("win-fixed-size", "#f").setValue("#t")
ConfigVariableBool("win-fixed-size").setValue(1)
ConfigVariableInt("win-fixed-size").setValue(1)

Well, you have to set it before you import DirectStart and/or before you create a ShowBase, like any other window-controlling config variables. Or you can just edit your Config.prc file and put it there.

If you don’t have a per-application Config.prc file, then you have to set it in Python code. A lot of people prefer to set this sort of thing at runtime with lines at the beginning of the program like this:

from pandac.PandaModules import *
loadPrcFileData('', 'win-fixed-size 1')
from direct.directbase import DirectStart

David

That didn’t work either. I plan on moving the config stuff to an external file, but for now I’m just keeping it in the client code for easy reference.

Here’s what I’ve got right now:

import sys

try: width = sys.argv[1]
except IndexError: width = 600
# lets you set the window width from the command prompt

try: height = sys.argv[2]
except IndexError: height = 400
# lets you set the window height from the command prompt

print "Resolution: " + str(width) + "x" + str(height)

from pandac.PandaModules import * 
ConfigVariableString("window-title", "Panda").setValue("Client")
ConfigVariableString("win-size", "640 480").setValue(width + " " + height)
loadPrcFileData('', 'win-fixed-size 1') 
import direct.directbase.DirectStart

The 2 ConfigVariableString commands work, setting the window size to what I want and changing the window title from ‘Panda’ to just ‘Client’. But I can’t seem to get window resizing to be disabled.

Your code works fine for me.

Ah, on closer inspection, it appears that there was a bug in 1.7.0 with win-fixed-size. This bug has been recently fixed in the cvs version, which is why it was working for me. Try installing the latest snapshot build to see if it takes care of the issue for you.

David

I downloaded and installed the snapshot build (1.7.1), and it’s not working either :frowning:

Maybe Windows XP just doesn’t like that command? lol

Hmm, I just installed that buildbot version, and it works fine. Are you sure you were running the new version and not, inadvertently, the old version? Try uninstalling all other versions of Panda just to be sure.

David