def __init__(self, keytype, filepath, name, screenName=None, baseName=None, className='Tix'): super().__init__(screenName, baseName, className) self.settings = Settings(keytype=keytype, filepath=filepath, name=name) self.settings.geometry = self.geometry
class DirSelectBox(tix.DirSelectBox): def __init__(self, master, name, cnf={}, **kw): super().__init__(master, cnf, **kw) self.settings = Settings(name=name, parent=master.settings) self.settings.__setattr__(name, self.__get_set) def __get_set(self, value=None): if value: self.selection.set(value) else: return self.selection.get()
class Control(tix.Control): def __init__(self, master, name, cnf={}, **kw): super().__init__(master, cnf, **kw) self.settings = Settings(name=name, parent=master.settings) self.settings.__setattr__(name, self.__get_set) def __get_set(self, value=None): if value: self.entry.delete(0, 'end') self.entry.insert('end', value) else: return self.entry.get()
class Tk(tix.Tk): def __init__(self, keytype, filepath, name, screenName=None, baseName=None, className='Tix'): super().__init__(screenName, baseName, className) self.settings = Settings(keytype=keytype, filepath=filepath, name=name) self.settings.geometry = self.geometry def destroy(self): self.settings.save() super().destroy()
def __init__(self, master, name, cnf={}, **kw): super().__init__(master, cnf, **kw) self.settings = Settings(name=name, parent=master.settings) self.settings.__setattr__(name, self.__get_set)
def add(self, name, cnf={}, **kw): frame = super().add(name, cnf**kw) frame.settings = Settings(name=name, parent=self.settings)