Advertisement
AceScottie

Untitled

Feb 2nd, 2022
1,096
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. from tkinter import Entry, StringVar, TOP
  2. class traceEntry(Entry):
  3.     def __init__(self, master, **kwargs):
  4.         self.var = StringVar()
  5.         trace = None
  6.         if 'trace' in kwargs.keys():
  7.             trace= kwargs['trace']
  8.             del kwargs['trace']
  9.         kwargs['textvariable'] = self.var
  10.         Entry.__init__(*(self, master), **kwargs)
  11.         if traceis not None:
  12.             self.var.trace('w', command=trace)
  13.     def get(self):
  14.         return self.var.get()
  15.  
  16. myentrys = {}
  17. for i in range(100):
  18.     myentries["e%s"%i] = traceEntry(root, trace=check)
  19.     myentries["e%s"%i].pack(side=TOP)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement