本文整理汇总了Python中pandac.PandaModules.WindowProperties.setDefault方法的典型用法代码示例。如果您正苦于以下问题:Python WindowProperties.setDefault方法的具体用法?Python WindowProperties.setDefault怎么用?Python WindowProperties.setDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandac.PandaModules.WindowProperties
的用法示例。
在下文中一共展示了WindowProperties.setDefault方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupWindow
# 需要导入模块: from pandac.PandaModules import WindowProperties [as 别名]
# 或者: from pandac.PandaModules.WindowProperties import setDefault [as 别名]
def setupWindow(self, windowType, x, y, width, height,
parent):
""" Applies the indicated window parameters to the prc
settings, for future windows; or applies them directly to the
main window if the window has already been opened. This is
called by the browser. """
if self.started and base.win:
# If we've already got a window, this must be a
# resize/reposition request.
wp = WindowProperties()
if x or y or windowType == 'embedded':
wp.setOrigin(x, y)
if width or height:
wp.setSize(width, height)
if windowType == 'embedded':
wp.setParentWindow(parent)
wp.setFullscreen(False)
base.win.requestProperties(wp)
self.windowProperties = wp
return
# If we haven't got a window already, start 'er up. Apply the
# requested setting to the prc file, and to the default
# WindowProperties structure.
self.__clearWindowProperties()
if windowType == 'hidden':
data = 'window-type none\n'
else:
data = 'window-type onscreen\n'
wp = WindowProperties.getDefault()
wp.clearParentWindow()
wp.clearOrigin()
wp.clearSize()
wp.setFullscreen(False)
if windowType == 'fullscreen':
wp.setFullscreen(True)
if windowType == 'embedded':
wp.setParentWindow(parent)
if x or y or windowType == 'embedded':
wp.setOrigin(x, y)
if width or height:
wp.setSize(width, height)
self.windowProperties = wp
self.windowPrc = loadPrcFileData("setupWindow", data)
WindowProperties.setDefault(wp)
self.gotWindow = True
# Send this call to the main thread; don't call it directly.
messenger.send('AppRunner_startIfReady', taskChain = 'default')