Calling functions from a Tkinter Frame to another

前端 未结 2 938
滥情空心
滥情空心 2020-11-27 08:14

I have a page where I\'ll show some customers details. So I created a page called \"customers details\" with all the labels that I need and I set the text of these labels as

2条回答
  •  执念已碎
    2020-11-27 08:31

    You could consider saving references to you GUI fields you need to update in, for example, a dict in your MyApp class. That way you can access them from anywhere in the class regardless of where the actual GUI element happens to be placed.

    GUI programming usually produces quite messy classes, using a dict to keep track of the elements reduces the mess. Others like to keep separate class attributes for each element you need to access later.

提交回复
热议问题