def __init__(self, response=str, text="", title=None, accept=0, **options):
if response is bool:
self.dialog = [askyesno, askokcancel, askretrycancel][accept]
else: self.dialog = {None:showinfo, str:askstring, int:askinteger, float:askfloat,
0:askopenfilename, 1:asksaveasfilename, 2:askdirectory}[response]
self.options = options.copy()
if "initialdir" in options:
self.options["initialdir"] = abspath(options["initialdir"])
if type(response) is int:
self.args = tuple()
if title: self.options["title"] = title
else:
if title is None:
title = "Info" if response is None else "Confirm" if response is bool else "Input"
self.args = title, text
评论列表
文章目录