(self, prefs=None)
return
Load table specific prefs from the prefs instance used
           if they are not present, create them.
Load table specific prefs from the prefs instance used
           if they are not present, create them.
Load table specific prefs from the prefs instance used if they are not present create them .
def loadPrefs(self, prefs=None):
        """Load table specific prefs from the prefs instance used
           if they are not present, create them."""

        if prefs == None:
            prefs=Preferences('Table',{'check_for_update':1})
        self.prefs = prefs
        defaultprefs = {'horizlines':self.horizlines, 'vertlines':self.vertlines,
                        'alternaterows':self.alternaterows,
                        'rowheight':self.rowheight,
                        'cellwidth':100,
                        'autoresizecols': 0,
                        'align': 'w',
                        'celltextsize':11, 'celltextfont':'Arial',
                        'bgcolor': self.bgcolor, 'grid_color': self.grid_color,
                        'linewidth' : self.linewidth,
                        'rowselectedcolor': self.rowselectedcolor,
                        'rowheaderwidth': self.rowheaderwidth}

        #print (self.prefs.__dict__)
        for prop in defaultprefs:
            if not prop in self.prefs.prefs:
                #print (defaultprefs[prop])
                if defaultprefs[prop] != 'None':
                    self.prefs.set(prop, defaultprefs[prop])

        self.defaultprefs = defaultprefs

        #Create tkvars for dialog
        self.rowheightvar = IntVar()
        self.rowheightvar.set(self.prefs.get('rowheight'))
        self.rowheight = self.rowheightvar.get()
        self.cellwidthvar = IntVar()
        self.cellwidthvar.set(self.prefs.get('cellwidth'))
        self.cellwidth = self.cellwidthvar.get()
        self.cellalignvar = StringVar()
        self.cellalignvar.set(self.prefs.get('align'))
        self.align = self.cellalignvar.get()
        self.linewidthvar = IntVar()
        self.linewidthvar.set(self.prefs.get('linewidth'))
        self.horizlinesvar = IntVar()
        self.horizlinesvar.set(self.prefs.get('horizlines'))
        self.vertlinesvar = IntVar()
        self.vertlinesvar.set(self.prefs.get('vertlines'))
        self.alternaterowsvar = IntVar()
        self.alternaterowsvar.set(self.prefs.get('alternaterows'))
        self.celltextsizevar = IntVar()
        self.celltextsizevar.set(self.prefs.get('celltextsize'))
        self.bgcolor = self.prefs.get('bgcolor')
        self.grid_color = self.prefs.get('grid_color')
        self.rowselectedcolor = self.prefs.get('rowselectedcolor')
        self.fontsize = self.celltextsizevar.get()
        self.thefont = (self.prefs.get('celltextfont'), self.prefs.get('celltextsize'))
        self.rowheaderwidthvar = IntVar()
        self.rowheaderwidthvar.set(self.prefs.get('rowheaderwidth'))
        self.rowheaderwidth = self.rowheaderwidthvar.get()
        return
def loadPrefs ( self , prefs = None ) : if prefs == None : prefs = Preferences ( 'Table' , { 'check_for_update' : 1 } ) self . prefs = prefs defaultprefs = { 'horizlines' : self . horizlines , 'vertlines' : self . vertlines , 'alternaterows' : self . alternaterows , 'rowheight' : self . rowheight , 'cellwidth' : 100 , 'autoresizecols' : 0 , 'align' : 'w' , 'celltextsize' : 11 , 'celltextfont' : 'Arial' , 'bgcolor' : self . bgcolor , 'grid_color' : self . grid_color , 'linewidth' : self . linewidth , 'rowselectedcolor' : self . rowselectedcolor , 'rowheaderwidth' : self . rowheaderwidth } #print (self.prefs.__dict__) for prop in defaultprefs : if not prop in self . prefs . prefs : #print (defaultprefs[prop]) if defaultprefs [ prop ] != 'None' : self . prefs . set ( prop , defaultprefs [ prop ] ) self . defaultprefs = defaultprefs #Create tkvars for dialog self . rowheightvar = IntVar ( ) self . rowheightvar . set ( self . prefs . get ( 'rowheight' ) ) self . rowheight = self . rowheightvar . get ( ) self . cellwidthvar = IntVar ( ) self . cellwidthvar . set ( self . prefs . get ( 'cellwidth' ) ) self . cellwidth = self . cellwidthvar . get ( ) self . cellalignvar = StringVar ( ) self . cellalignvar . set ( self . prefs . get ( 'align' ) ) self . align = self . cellalignvar . get ( ) self . linewidthvar = IntVar ( ) self . linewidthvar . set ( self . prefs . get ( 'linewidth' ) ) self . horizlinesvar = IntVar ( ) self . horizlinesvar . set ( self . prefs . get ( 'horizlines' ) ) self . vertlinesvar = IntVar ( ) self . vertlinesvar . set ( self . prefs . get ( 'vertlines' ) ) self . alternaterowsvar = IntVar ( ) self . alternaterowsvar . set ( self . prefs . get ( 'alternaterows' ) ) self . celltextsizevar = IntVar ( ) self . celltextsizevar . set ( self . prefs . get ( 'celltextsize' ) ) self . bgcolor = self . prefs . get ( 'bgcolor' ) self . grid_color = self . prefs . get ( 'grid_color' ) self . rowselectedcolor = self . prefs . get ( 'rowselectedcolor' ) self . fontsize = self . celltextsizevar . get ( ) self . thefont = ( self . prefs . get ( 'celltextfont' ) , self . prefs . get ( 'celltextsize' ) ) self . rowheaderwidthvar = IntVar ( ) self . rowheaderwidthvar . set ( self . prefs . get ( 'rowheaderwidth' ) ) self . rowheaderwidth = self . rowheaderwidthvar . get ( ) return