tkinter - how to refresh the window in python -


I have a function that will display the attributes of an image. After it is displayed, I want to refresh it for the next image, for example if I have a window like

Once I have the Refresh button window should be like this Enter image details here

Initially, every feature value is set to zero. How to get it? I have tried with grid_forget () , it will not give me what I wanted. I do not want to clean the window, I just want to clear the entries in each entry box, and I also want to clear the label so that I can select another image

Thanks in advance!

If you have too many login widgets, such as in your example, you can use the method Obtain the list of all children widgets of an object. After this, you can repeat through this list to reset and configure those widgets:

  root = Tk () def clear_all ( ): For the widget in root.winfo_children (): # Get All Children Root if widget.winfo_class () == 'Entry': # If Class Entry The widget is. Edit (0, END) # Reset its value alif widget. Config (BG = 'green') # and also convert them to # Set Up Misc Range (5) Visits: Entry (route) .pack () label (root, height = 10, width = 100, bg = 'red '). Pack () button (root, text = 'refresh', command = clear_all) .pack () menloof ()    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -