Hi, I have a class (a gui) with buttons and other controls. A button, for example, has a callback method, so that writing b = Button(label, OnClick) will call the global OnClick method. Now, if I want the OnClick method to call some of my main class methods, I need to write: UI = None ... class MainClass: ... global UI = self Then, def OnClik(button): UI.do_something(button.get_label()) Is this the correct way to do it in Python ? Isn't there a potential flaw in declaring my MainClass instance as a global variable ?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4