GliderGeek / PySoar

Gliding competition analysis
http://www.pysoar.com
GNU General Public License v3.0
17 stars 7 forks source link

Python Tkinter Entry Widget #144

Closed prem2179 closed 5 years ago

prem2179 commented 5 years ago

Hello,

I have a tabbed interface with multiple Entry widgets on each tab. I need to create a function to clear the contents of th Shift_Management.zip

e entry widgets when I click on a button. The number of entry widgets are different on each tab and I need a dynamic code irrespective of number of widgets. The alternate option is to write code to manually clear all entry widgets. but I need a common function to be used across all tabs.

Attached the the GUI that I have created. On clicking NEW button, it needs to be cleared. Regards Prem Thakkar

GliderGeek commented 5 years ago

i dont follow how this is related to pysoar, could you explain this?

gauravguptagg commented 5 years ago

If I recall Tkinter correctly, there is a way to list out all the widgets under a particular parent. I can get the name of the function, if you're unable to find it.

Once you have all the widgets under a particular parent, just search which one of them have properties of an entry widget. How? you might ask. There are multiple methods

  1. Try updating a property you know that only exists in an entry widget. Such as try running the .insert on all the children, and put a try catch around each. This way, the ones that don't have an insert method will get "excepted" and the entry method will work.

  2. Get the attributes of each child widget. The one that matches with your entry widget, only run .insert on them. This relies on the fact that the attributes of the entry widget of your different tabs is similar. If not, the 1st method is good for you.

If you're stuck, please message me directly. I'm new to GitHub. I hope I was able to solve your issue.

GliderGeek commented 5 years ago

closing this issue, because unrelated to pysoar