ein lambda als command für send_clicked erwirkt schonmal, dass die Nachricht nicht direkt zum Load des Skripts angezeigt wird, allerdings funktioniert "on-click" noch nicht
This commit is contained in:
parent
23eb17a3c5
commit
068b746bc8
17
journal.py
17
journal.py
|
|
@ -12,21 +12,18 @@ height = journal.winfo_screenheight()
|
||||||
journal.geometry("%dx%d" % (width, height))
|
journal.geometry("%dx%d" % (width, height))
|
||||||
journal.title("Ameland Kinderjournal")
|
journal.title("Ameland Kinderjournal")
|
||||||
|
|
||||||
# store name and message
|
|
||||||
name = tk.StringVar()
|
|
||||||
message = tk.StringVar()
|
|
||||||
|
|
||||||
|
|
||||||
def send_clicked():
|
def send_clicked():
|
||||||
""" callback when the message has been composed and "Abschicken" has been clicked
|
""" callback when the message has been composed and "Abschicken" has been clicked
|
||||||
"""
|
"""
|
||||||
msg = f'Deine Nachricht wurde gespeichert'
|
msg = f'Deine Nachricht wurde gespeichert',
|
||||||
showinfo(
|
command = lambda: showinfo(title="Information", message="Deine Nachricht wurde gespeichert")
|
||||||
title='Information',
|
|
||||||
message=msg
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
# store name and message
|
||||||
|
name = tk.StringVar()
|
||||||
|
message = tk.StringVar()
|
||||||
|
|
||||||
# Main Window
|
# Main Window
|
||||||
journal = ttk.Frame(journal)
|
journal = ttk.Frame(journal)
|
||||||
journal.pack()
|
journal.pack()
|
||||||
|
|
@ -45,7 +42,7 @@ message_text = tk.Text(journal, height=50)
|
||||||
message_text.pack()
|
message_text.pack()
|
||||||
|
|
||||||
# Send Button
|
# Send Button
|
||||||
button = ttk.Button(journal, text="Abschicken", command=send_clicked())
|
button = ttk.Button(journal, text="Abschicken", command=send_clicked(), default="disabled")
|
||||||
button.pack()
|
button.pack()
|
||||||
|
|
||||||
journal.mainloop()
|
journal.mainloop()
|
||||||
Loading…
Reference in New Issue
Block a user