def initKw(self, kw): kw = KwStruct( kw, timeout=0, resizable=0, text="", justify="center", strings=("OK", ), default=0, width=0, font=self.getDefaultFont(), buttonfont=self.getDefaultFont(), padx=20, pady=20, bitmap=None, bitmap_side="left", bitmap_padx=10, bitmap_pady=20, image=None, image_side="left", image_padx=10, image_pady=20, ) # default to separator if more than one button sw = 2 * (len(kw.strings) > 1) kwdefault(kw.__dict__, separatorwidth=sw) return kw
def initKw(self, kw): kw = KwStruct( kw, strings=("OK", "Cancel"), default=0, separatorwidth=0, ) return MfxDialog.initKw(self, kw)
def __init__(self, parent, ex, title="Error", **kw): kw = KwStruct(kw, bitmap="error") text = str(kw.get("text", "")) if text and text[-1] != "\n": text = text + "\n" text = text + "\n" if isinstance(ex, EnvironmentError) and ex.filename is not None: t = "[Errno %s] %s:\n%s" % (ex.errno, ex.strerror, repr( ex.filename)) else: t = str(ex) kw.text = text + t apply(MfxDialog.__init__, (self, parent, title), kw.getKw())