Logo Search packages:      
Sourcecode: pythoncard version File versions  Download package

def PythonCard-0.8.1::model::CustomDialog::__init__ (   self,
  aBg,
  aDialogRsrc = None 
)

Initialize this instance.

Definition at line 1852 of file model.py.

01852                                              :
        """
        Initialize this instance.
        """
        Scriptable.__init__( self, None)

        self.parent = aBg
        self.application = wx.GetApp()

        # KEA 2002-09-13
        # if a resource isn't provided, try and load
        # a default based on the name
        if aDialogRsrc is None:
            if util.main_is_frozen():
                # KEA 2004-05-20
                # running standalone
                # need to support py2exe differently than bundlebuilder and mcmillan probably
                # but this is the py2exe 0.5 way
                # figure out the .rsrc.py filename based on the module name stored in library.zip
                filename = os.path.split(sys.modules[self.__class__.__module__].__file__)[1]
                filename = os.path.join(self.parent.application.applicationDirectory, filename)
            else:
                # figure out the .rsrc.py filename based on the module name
                filename = sys.modules[self.__class__.__module__].__file__
            # chop the .pyc or .pyo from the end
            base, ext = os.path.splitext(filename)
            filename = internationalResourceName(base)
            aDialogRsrc = resource.ResourceFile(filename).getResource()
        else:
            if isinstance(aDialogRsrc, dict):
                aDialogRsrc = resource.Resource(aDialogRsrc)
        
        self.resource = aDialogRsrc

        self.id = wx.NewId()
        self.setName( aDialogRsrc.name )
        self.components = WidgetDict(self)

        # First, call the base class' __init__ method to create the dialog
        wx.Dialog.__init__( self, self.parent,   
                          -1, 
                          aDialogRsrc.title,
                          aDialogRsrc.position, 
                          aDialogRsrc.size )

        self._initLayout( aDialogRsrc.components )

    # this allows the labels to be something other than Ok, Cancel, No, etc.
    def _returnedString(self, returned):


Generated by  Doxygen 1.6.0   Back to index