Code: Alles auswählen
from tkinter import *
from tkinter import messagebox
import time as t
main_window = Tk()
main_window.title("JustDoIt!")
def new_to_do_ok():
if new_to_do_entry == '':
new_to_do_label.config(text = 'Gib zuerst eine Aufgabe ein!!!')
t.sleep(4)
new_to_do_label.config(text = 'Gib die neue Aufgabe hier ein')
def new_to_do():
new_to_do_window = Tk()
new_to_do_window.title('Neue Aufgabe erstellen')
new_to_do_label = Label(new_to_do_window, text = 'Gib die neue Aufgabe hier ein').pack()
new_to_do_entry = Entry(new_to_do_window).pack()
new_to_do_button = Button(new_to_do_window, text = 'OK', command =
def exit_main_window():
main_window.destroy()
menuleiste = Menu(main_window)
datei_menu = Menu(menuleiste, tearoff=1)
datei_menu.add_command(label="Neuen Eintrag erstellen", command=new_to_do)
datei_menu.add_separator()
datei_menu.add_command(label="Exit", command=exit_main_window)
menuleiste.add_cascade(label="Datei", menu=datei_menu)
main_window.config(menu=menuleiste)
mainloop()
Code: Alles auswählen
def exit_main_window():
main_window.destroy()
Code: Alles auswählen
File "/home/pi/mu_code/fonts/Checkliste/Maincode.py", line 22
def exit_main_window():
^
SyntaxError: invalid syntax
>>>
Vielen Dank schonmal für die Hife!!
