Python Forum
Calling widget from another function?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling widget from another function?
#2
Here's the explanation as to why you had to do that:

In your original code, t_entry was a local variable inside the __init__() method. Therefore, when the method finished, it ceased to exist. Whereas, when you name it self.t_entry, it becomes an attribute of the Inv class and exists after the __init__() method has finished. Then, to call it up again, you treat it like any other class attribute and call up Inv.t_entry - which is self.t_entry within the methods of the Inv class.
Reply


Messages In This Thread
RE: Calling widget from another function? - by stullis - Oct-23-2018, 12:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem In calling a Function from another python file of project vinod2810 7 5,362 Oct-05-2019, 01:09 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020