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

View file

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

0
notizen_w/test.py Normal file
View file