insert ( '', 'end', text = "Item_" + str ( self. La méthode d'insertion est celui-ci: def insert_data ( self ): """ Mais vous pouvez ajouter une étiquette et une entrée pour cette fin au lieu et vous insérez des éléments des noms de la même façon pour les autres Tkinter.Entry() entrées. J'ai donc mis un compteur self.i pour nommer les éléments. Ici est de savoir comment l'application de démonstration ressemble: Vous pouvez adapter la solution à votre problème. J'ai conçu une interface simple pour vous montrer comment résoudre ce problème. Vous semblent ne s'intéresser qu'à la façon d'insérer les données de l'utilisateur tape dans Tkinter.Entry() widgets dans ttk.Treeview() après un Tkinter.Button() cliquez sur. Ou est treeview le droit widget pour cela, ou peut-on suggérer un widget adapté pour ce problème? grâce insert ( 'WHAT SHOULD I GIVE AS AN ARGUMENT?' ) # Clears the Entry box, ready for another data entry. get () # Inserts data written in the entry box to the treeview widget when Enter button is pressed. grid ( row = 2, column = 2, columnspan = 4, sticky = 'nsew' ) def insert_value ( self ): heading ( '#2', text = 'date modified', anchor = tk. heading ( '#1', text = 'dose', anchor = tk. heading ( '#0', text = 'item', anchor = tk. Treeview ( self, height = 28, columns =( 'dose', 'date modified' ), selectmode = "extended" )Ĭhat1. grid ( row = 1, column = 4, columnspan = 2, sticky = 'w' )Ĭhat1 = ttk. Button ( self, text = 'Enter', command = self. grid ( row = 1, column = 2, columnspan = 2, sticky = 'w' ) ![]() Entry ( self, width = 100, textvariable = self. ![]() Label ( self, text = 'Purchase Entry:' ) grid ( row = 0, columnspan = 3, sticky = 'w' ) Label ( self, text = 'Purchase Entry', font = LARGE_FONT2 ) Frame ): def _init_ ( self, parent, controller ): Im nouveau à python et tkinter, et il n'y a pas beaucoup de tutoriaux sur treeview. Je veux les éléments tapé dans l'entrée pour être inséré dans le contrôle treeview lorsque sur la touche enter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |