def __init__(self, parent=None, gui=None): # First phase: load the configurations. if gui == "dgui": from dgui.pConfig import Config elif gui == "wxgui": from wxgui.pConfig import Config if gui is not None: Config.loadConfig() # Second phase: initialize the window manager (which starts ShowBase) from core.pWindow import WindowManager if gui == "dgui": WindowManager.startBase(showDefaultWindow=True, allowMultipleWindows=False) elif gui == "wxgui": WindowManager.startBase(showDefaultWindow=False, allowMultipleWindows=True) else: from direct.directbase import DirectStart if parent is None: parent = render self.editorGui = False self.guiType = gui self.editModeEnabled = False soundManager.enable() self.treeParent = SceneNodeWrapper.onCreateInstance( None, 'default.egg')
def __init__(self, parent=None, gui=None): # First phase: load the configurations. if gui == "dgui": from dgui.pConfig import Config elif gui == "wxgui": from wxgui.pConfig import Config if gui is not None: Config.loadConfig() # Second phase: initialize the window manager (which starts ShowBase) from core.pWindow import WindowManager if gui == "dgui": WindowManager.startBase(showDefaultWindow = True, allowMultipleWindows = False) elif gui == "wxgui": WindowManager.startBase(showDefaultWindow = False, allowMultipleWindows = True) else: from direct.directbase import DirectStart if parent is None: parent = render self.editorGui = False self.guiType = gui self.editModeEnabled = False soundManager.enable() self.treeParent = SceneNodeWrapper.onCreateInstance(None, 'default.egg')
from pandac.PandaModules import TextNode, Vec3 from direct.gui.DirectGui import DirectFrame,DirectButton,DirectScrolledFrame,DGG from core.pWindow import WindowManager if __name__ == '__main__': # to test the directWindow independantly WindowManager.startBase(showDefaultWindow = True, allowMultipleWindows = False) # define model path, required if this settings is missing in the Config.pp from pandac.PandaModules import * for path in ['../data', './dgui/directWindow/data', './src/dgui/directWindow/data']: getModelPath( ).appendPath( path ) DEFAULT_TITLE_TEXTURE_LEFT = 'titleLeft.png' DEFAULT_TITLE_TEXTURE_CENTER = 'titleCenter.png' DEFAULT_TITLE_TEXTURE_RIGHT = None DEFAULT_TITLE_GEOM_RIGHT = 'titleRight.egg' DEFAULT_RESIZE_GEOM = 'resize.png' Y_INVERTED = True class DirectWindow( DirectFrame ): def __init__( self , pos = ( -.5, .5) , title = 'Title' , bgColor = (.5,.5,.5,1) , buttonColor = (1,1,1,1) #( .6, .6, .6, 1 ) #, minSize = ( .5, .5 ) #, maxSize = ( 1, 1 )