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
19
journal.py
19
journal.py
|
|
@ -12,21 +12,18 @@ height = journal.winfo_screenheight()
|
|||
journal.geometry("%dx%d" % (width, height))
|
||||
journal.title("Ameland Kinderjournal")
|
||||
|
||||
# store name and message
|
||||
name = tk.StringVar()
|
||||
message = tk.StringVar()
|
||||
|
||||
|
||||
def send_clicked():
|
||||
""" callback when the message has been composed and "Abschicken" has been clicked
|
||||
"""
|
||||
msg = f'Deine Nachricht wurde gespeichert'
|
||||
showinfo(
|
||||
title='Information',
|
||||
message=msg
|
||||
)
|
||||
msg = f'Deine Nachricht wurde gespeichert',
|
||||
command = lambda: showinfo(title="Information", message="Deine Nachricht wurde gespeichert")
|
||||
|
||||
|
||||
# store name and message
|
||||
name = tk.StringVar()
|
||||
message = tk.StringVar()
|
||||
|
||||
# Main Window
|
||||
journal = ttk.Frame(journal)
|
||||
journal.pack()
|
||||
|
|
@ -45,7 +42,7 @@ message_text = tk.Text(journal, height=50)
|
|||
message_text.pack()
|
||||
|
||||
# Send Button
|
||||
button = ttk.Button(journal, text="Abschicken", command=send_clicked())
|
||||
button = ttk.Button(journal, text="Abschicken", command=send_clicked(), default="disabled")
|
||||
button.pack()
|
||||
|
||||
journal.mainloop()
|
||||
journal.mainloop()
|
||||
Loading…
Reference in New Issue
Block a user