please help

This commit is contained in:
Michael S. 2023-11-21 22:48:32 +01:00
parent 292b44ea57
commit 83ee5bc396
3 changed files with 34 additions and 25 deletions

View file

@ -84,6 +84,7 @@ Passwort:""")
class actions():
def edit():
notiz = eigene_dialoge.notiz_auswahl()
print("Notiz ausgewählt")
write_note = eigene_dialoge.notiz_dialog(notiz)
info = neditadd(write_note[0],write_note[1])
messagebox("Notiz",info)
@ -119,35 +120,43 @@ Passwort:""")
class eigene_dialoge:
def notiz_dialog(title):
notiz = o(title,"r")
w_editnotiz = tk.Tk()
notiz_dialog = tk.Tk()
def cancel():
w_editnotiz.destroy()
global ret
ret = tk.StringVar(notiz_dialog)
ret.set([title,notiz.read()])
notiz_dialog.destroy()
print(ret.get())
def ok():
global ret
ret = tk.StringVar(w_editnotiz)
ret.set([l_wtitle.get(),l_winhalt.get()])
w_editnotiz.destroy()
ret = tk.StringVar(notiz_dialog)
ret.set([ltitle.get(),linhalt.get()])
notiz_dialog.destroy()
print(ret.get())
l_wttitle = tk.Label(w_editnotiz, text="Titel:")
l_wtitle = tk.Entry(w_editnotiz)
l_wtitle.insert(0,title)
l_wtinhalt = tk.Label(w_editnotiz, text="Inhalt:")
l_winhalt = tk.Entry(w_editnotiz)
l_winhalt.insert(0,notiz.read())
l_button_save = tk.Button(w_editnotiz, text="Save" ,command=ok)
l_button_cancel = tk.Button(w_editnotiz, text="Abbrechen" ,command=cancel)
lttitle = tk.Label(notiz_dialog, text="Titel:")
ltitle = tk.Entry(notiz_dialog)
ltitle.insert(0,title)
print(title)
ltinhalt = tk.Label(notiz_dialog, text="Inhalt:")
linhalt = tk.Entry(notiz_dialog)
print(notiz.read())
linhalt.insert(0,notiz.read())
lbutton_save = tk.Button(notiz_dialog, text="Save" ,command=ok)
lbutton_cancel = tk.Button(notiz_dialog, text="Abbrechen" ,command=cancel)
l_wttitle.pack()
l_wtitle.pack()
l_wtinhalt.pack()
l_winhalt.pack()
l_button_save.pack()
l_button_cancel.pack()
lttitle.pack()
ltitle.pack()
ltinhalt.pack()
linhalt.pack()
lbutton_save.pack()
lbutton_cancel.pack()
l_button_save.pack(fill="x")
l_button_cancel.pack(fill="x")
w_editnotiz.mainloop()
lbutton_save.pack(fill="x")
lbutton_cancel.pack(fill="x")
notiz_dialog.mainloop()
return ret.get()
def notiz_auswahl():
def done():
@ -169,8 +178,6 @@ class eigene_dialoge:
class tkf :
def refresh_list():
notiz_list.set(nlist()[0])
def help():
messagebox.showinfo("help", """Hilfe:
edit = Bearbeite eine Notiz.
@ -211,8 +218,9 @@ if not os.path.exists(f"{n_path}n{tzeichen}"):
messagebox.showinfo("Verzeichniss","Notizenverzeichniss angelegt.")
n_path += "n"+tzeichen
eigene_dialoge.notiz_dialog("dodel")
#eigene_dialoge.notiz_auswahl()
#exit()
exit()
# Welcome screen
passwort = eigene_fenster.welcome_w()
# main fenster

View file

@ -0,0 +1 @@
hääääää

0
notizen_w/test.py Normal file
View file