# tkMessageBox example code by Dan Rahmel # I had a difficult time finding example code showing how to use the Tkinter Messagebox functions. # After I figured it out, I put together this brief sample.

import leoGlobals as g import leoPlugins

import tkMessageBox

# Messageboxes for questions answer = tkMessageBox.askyesno("askyesno", "Hello from askyesnon1 of 7") # Change default button. Can be ABORT, RETRY, IGNORE, OK, CANCEL, YES, NO answer = tkMessageBox.askquestion(title="askquestion", message="Hello from askquestionn2 of 7", fault=tkMessageBox.NO) answer = tkMessageBox.askokcancel("askokcancel", "Hello from askokcanceln3 of 7") answer = tkMessageBox.askretrycancel("askretrycancel", "Hello from askretrycanceln4 of 7")

# Messageboxes for info answer = tkMessageBox.showinfo("showinfo", "Hello from showinfon5 of 7") answer = tkMessageBox.showerror("showerror", "Hello from showerrorn6 of 7") warningMsg = "showwarning" answer = tkMessageBox.showwarning("showwarning","Final hello from:n(%s)n7 of 7" % warningMsg)