def yesno(self, heading, line1, line2=None, line3=None, nolabel=None, yeslabel=None):
"""Show a dialog 'YES/NO'.
heading: string or unicode - dialog heading.
line1: string or unicode - line #1 text.
line2: string or unicode - line #2 text.
line3: string or unicode - line #3 text.
nolabel: label to put on the no button.
yeslabel: label to put on the yes button.
Note:
Returns True if 'Yes' was pressed, else False.
Example:
dialog = xbmcgui.Dialog()
ret = dialog.yesno('XBMC', 'Do you want to exit this script?')
"""
root = self.root
prompt = [elem for elem in [line1, line2, line3] if elem]
message = '\n'.join(prompt)
ans = tkMessageBox.askyesno(heading, message, parent=root)
root.destroy()
return ans[0]
评论列表
文章目录