examples for dialogs
This commit is contained in:
parent
0564517d70
commit
d8320031a3
|
@ -94,3 +94,4 @@ ENV/
|
||||||
# Rope project settings
|
# Rope project settings
|
||||||
.ropeproject
|
.ropeproject
|
||||||
|
|
||||||
|
*.png
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
# example_006.py
|
||||||
|
from tkinter.filedialog import askopenfilename
|
||||||
|
|
||||||
|
def main():
|
||||||
|
filename = askopenfilename(title='Markdown öffnen',
|
||||||
|
filetypes=[('Markdown', '*.md'),
|
||||||
|
('Compressed Markdown', '*.md.zip')],
|
||||||
|
initialdir='.')
|
||||||
|
print(filename)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
|
@ -0,0 +1,10 @@
|
||||||
|
# example_007.py
|
||||||
|
from tkinter.messagebox import showinfo, showwarning, showerror
|
||||||
|
|
||||||
|
def main():
|
||||||
|
showinfo('Information (Titel)', 'Information (Nachricht)')
|
||||||
|
showwarning('Warnung (Titel)', 'Warnung (Nachricht)')
|
||||||
|
showerror('Fehler (Titel)', 'Fehler (Nachricht)')
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
|
@ -0,0 +1,19 @@
|
||||||
|
# example_008.py
|
||||||
|
from tkinter.messagebox import askokcancel, askquestion, askretrycancel, askyesno, askyesnocancel
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
response = askokcancel('askokcancel (Titel)', 'askokcancel (Nachricht)')
|
||||||
|
print(response)
|
||||||
|
response = askquestion('askquestion (Titel)', 'askquestion (Nachricht)')
|
||||||
|
print(response)
|
||||||
|
response = askretrycancel('askretrycancel (Titel)', 'askretrycancel (Nachricht)')
|
||||||
|
print(response)
|
||||||
|
response = askyesno('askyesno (Titel)', 'askyesno (Nachricht)')
|
||||||
|
print(response)
|
||||||
|
response = askyesnocancel('askyesnocancel (Titel)', 'askyesnocancel (Nachricht)')
|
||||||
|
print(response)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
Loading…
Reference in New Issue