DNATool2/DNAToolApp.py
def createChildFrame(self, sidepane=True, width=400, name=None):
        """Create a child frame in sidepane notebook or as toplevel"""
        geometry = '600x400+500+250'
        if sidepane == True:
            cframe = self.sidepane.add(name)
            self.sidepane.tab(name).configure(font='fixed 8',anchor='w')
            self.sidepane.selectpage(name)
        else:
            cframe = Toplevel()
            if name == None:
                title = 'default'
            else:
                title = name
            cframe.title(title)
        self.__dict__[name] = cframe
        #if name is a pre-defined app we load fetch the class
        if self.apps.has_key(name):
            cls = self.apps[name]
            inst = cls(cframe, parentapp=self)
            inst.pack(fill=BOTH,expand=1)
            self.appsvars[name].set(1)
            if hasattr(inst, 'geometry'):
                geometry = inst.geometry
        if sidepane == False:
            cframe.geometry(geometry)
        #bind frame close
        def func(evt):
            if hasattr(self, name):
                del self.__dict__[name]
            if name in self.appsvars:
                self.appsvars[name].set(0)
        cframe.bind("<Destroy>", func)
        return cframe
Create a child frame in sidepane notebook or as toplevel
Create a child frame in sidepane notebook or as toplevel
Create a child frame in sidepane notebook or as toplevel
def createChildFrame(self, sidepane=True, width=400, name=None):
        geometry = '600x400+500+250'
        if sidepane == True:
            cframe = self.sidepane.add(name)
            self.sidepane.tab(name).configure(font='fixed 8',anchor='w')
            self.sidepane.selectpage(name)
        else:
            cframe = Toplevel()
            if name == None:
                title = 'default'
            else:
                title = name
            cframe.title(title)
        self.__dict__[name] = cframe
        if self.apps.has_key(name):
            cls = self.apps[name]
            inst = cls(cframe, parentapp=self)
            inst.pack(fill=BOTH,expand=1)
            self.appsvars[name].set(1)
            if hasattr(inst, 'geometry'):
                geometry = inst.geometry
        if sidepane == False:
            cframe.geometry(geometry)
        def func(evt):
            if hasattr(self, name):
                del self.__dict__[name]
            if name in self.appsvars:
                self.appsvars[name].set(0)
        cframe.bind("<Destroy>", func)
        return cframe
def createChildFrame ( self , sidepane = True , width = 400 , name = None ) : geometry = '600x400+500+250' if sidepane == True : cframe = self . sidepane . add ( name ) self . sidepane . tab ( name ) . configure ( font = 'fixed 8' , anchor = 'w' ) self . sidepane . selectpage ( name ) else : cframe = Toplevel ( ) if name == None : title = 'default' else : title = name cframe . title ( title ) self . __dict__ [ name ] = cframe if self . apps . has_key ( name ) : cls = self . apps [ name ] inst = cls ( cframe , parentapp = self ) inst . pack ( fill = BOTH , expand = 1 ) self . appsvars [ name ] . set ( 1 ) if hasattr ( inst , 'geometry' ) : geometry = inst . geometry if sidepane == False : cframe . geometry ( geometry ) def func ( evt ) : if hasattr ( self , name ) : del self . __dict__ [ name ] if name in self . appsvars : self . appsvars [ name ] . set ( 0 ) cframe . bind ( "<Destroy>" , func ) return cframe
Create a child frame in sidepane notebook or as toplevel
Create a child frame in sidepane notebook or as toplevel
"""Create a child frame in sidepane notebook or as toplevel""" #if name is a pre-defined app we load fetch the class #bind frame close
self
sidepane
width
name