![]() Tv_nomi.heading('#3', text='Data di nascita') If query in tv_em(child):Ĭolumns=('Cognome', 'Nome', 'Data di nascita'), ![]() Also review more tutorials on creating tkinter widgets and windows.Īs I said, I am a moron so, I forgot to post the rewritten code, following the video… here is: import csv I would suggest redesigning your script using classes versus its current design approach. If it does exist, don’t create one to avoid overwriting the contents of the existing one. Therefore, in your code, you have to check if the file already exists. You’re attempting to read from a file that has yet to be created or doesn’t exist. Look into where you’re going to call this function to create the main window. You have the following function which isn’t called anywhere in order to create your window: def elenco_completo() Return filter in (entry.surname + entry.forename).casefold() # Sort them in the table to match their relative order in self.data.įor index, entry in enumerate(entries_showing): New_filter = self.filter_var.get().casefold()Įntries_showing = Self.cur_filter = self.filter_var.get().casefold() Self.filter_var.trace("w", self.filter_changed) With open(self.csv_path, encoding="utf-8") as file:Įntry.iid = ("", "end", values=astuple(entry)) nfig(command=)įor i, heading in enumerate(columns, start=1): Self.table = ttk.Treeview(frame, selectmode="extended", show="headings", columns=columns, yscrollcommand=t, xscrollcommand=t) id(row=1, column=0, sticky="we")Ĭolumns = Xscrollbar = tk.Scrollbar(frame, orient="horizontal") Yscrollbar = tk.Scrollbar(frame, orient="vertical") Self.filter_entry.pack(side="left", fill="x") Self.filter_entry = tk.Entry(frame, textvariable=self.filter_var) Tk.Label(frame, text="Filter:").pack(side="left") How can I implement other functionalities described as above?įrom dataclasses import dataclass, astuple Puls_chiudi_elenco = Button(frm_infospiti, text="Chiudi", command=chiudi_elenco) Tree_colonne.heading('#3', text="Data di nascita") Tree_colonne.heading('#1', text="Cognome") ![]() Tree_colonne.insert("", END, values=)Įntry = Entry(frm_infospiti, width=25, borderwidth=4, textvariable=dato_da_cercare) Tree_colonne.insert("", 0, values=(cognome, nome, nascita)) With open('/path/to/file.csv', 'r', encoding='UTF-8') as elenco: Tree_colonne = ttk.Treeview(frm_infospiti, selectmode='extended', height=15) Tree_colonne.insert("", 0, values=(search_var))Ĭolonne = ![]() Trova_digit = dato_da_cercare.get().capitalize() Then, I would that during the search, the other infos in the list disappear temporary from the screen until I digit something else. Self.arm2 = self.cv.I had wrote a function for searching names and various infos saved on a csv file.īasically it works, but it just bring up the result on the top of the treeview only if I wrote the whole name or else and not while I’m still typing on the keyboard. Self.cv.delete( self.head, self.body, self.arm1, self.arm2 ) Self.cv.create_text( 150, 20, text="Left-Click anywhere", \ Self.cv = Canvas( root, width=300, height=300 ) Anyone who has been in any forum for even a short time knows that guessing what the OP is trying to do is a complete waste of time. For anything more detailed, you will have to post your code. This uses a left click to determine the location (event.x, event.y) to draw the snowman, but the principle is the same. For whitespace, you would have to test event.x and event.y to see if you are over white space or not.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |