|
|
|
@ -90,16 +90,27 @@ class PersonFrame(customtkinter.CTkFrame):
|
|
|
|
|
# create textbox |
|
|
|
|
persons = get_person_all() |
|
|
|
|
personNames = [] |
|
|
|
|
for person in persons: |
|
|
|
|
personNames.append(person['Name']) |
|
|
|
|
if len(personNames) != 0: |
|
|
|
|
for person in persons: |
|
|
|
|
personNames.append(person['name']) |
|
|
|
|
else: |
|
|
|
|
personNames.append('Null') |
|
|
|
|
|
|
|
|
|
self.textbox = customtkinter.CTkTextbox(self, width=600, height=100) |
|
|
|
|
self.textbox.grid(row=0, column=0, padx=(20, 0), pady=(20, 0), sticky="nsew") |
|
|
|
|
self.textbox = customtkinter.CTkTextbox(self, height=100,) |
|
|
|
|
self.textbox.grid(row=0, column=0, columnspan=4, padx=(20, 0), pady=(20, 0), sticky="nsew") |
|
|
|
|
|
|
|
|
|
# set active person |
|
|
|
|
self.activePersonLabel = customtkinter.CTkLabel(self, text='Aktive Person') |
|
|
|
|
self.activePersonLabel.grid(row=1,column=0, padx=(20, 0), pady=(20,0), sticky="nw") |
|
|
|
|
self.optionMenu = customtkinter.CTkOptionMenu(self,values=personNames, command=self.optionmenu_callback) |
|
|
|
|
self.optionMenu.grid(row=2, column=0, padx=(20, 0), sticky="nw") |
|
|
|
|
self.optionMenu = customtkinter.CTkOptionMenu(self,values=personNames, command=self.optionmenu_callback, ) |
|
|
|
|
self.optionMenu.grid(row=2, column=0, padx=(20, 0), pady=(20,0), sticky="nws") |
|
|
|
|
# create person |
|
|
|
|
self.createPersonLabel = customtkinter.CTkLabel(self, text='Person erstellen') |
|
|
|
|
self.createPersonLabel.grid(row=1,column=1, padx=(20, 0), pady=(20,0), sticky="nw") |
|
|
|
|
self.personNameEntry = customtkinter.CTkEntry(self, placeholder_text='Name') |
|
|
|
|
self.personNameEntry.grid(row=2, column=1, padx=(20, 0), pady=(20,0), sticky='nw') |
|
|
|
|
self.createButton = customtkinter.CTkButton(self, text='Erstellen', command=self.createPerson) |
|
|
|
|
self.createButton.grid(row=2,column=2, padx=(20, 0), pady=(20,0), sticky='nw') |
|
|
|
|
# set default values |
|
|
|
|
self.textbox.insert("0.0", "Person\n\n" + 'Hier kannst du neue Personen erstellen, und die aktuell aktive Person auswählen') |
|
|
|
|
self.textbox.configure(state='disabled') |
|
|
|
@ -107,6 +118,10 @@ class PersonFrame(customtkinter.CTkFrame):
|
|
|
|
|
def optionmenu_callback(self, choice): |
|
|
|
|
print("optionmenu dropdown clicked:", choice) |
|
|
|
|
|
|
|
|
|
def createPerson(self): |
|
|
|
|
name = self.personNameEntry.get() |
|
|
|
|
print(name) |
|
|
|
|
|
|
|
|
|
class ExampleFrame(customtkinter.CTkFrame): |
|
|
|
|
def __init__(self, parent, controller): |
|
|
|
|
customtkinter.CTkFrame.__init__(self, parent) |
|
|
|
|