GTK4PythonTutorial
GTK4PythonTutorial copied to clipboard
Non-functioning code in the "Open with" and single instancing section.
I have been following this tutorial to make my side project and it has been very helpful. But the code
if not self.win: in the "Open with" and single instancing section gave me an error AttributeError: 'App' object has no attribute 'win'.. My understanding is i should use hasattr() instead?
In that example I added self.win = None to the applications init method. If you don't and try test for an attribute that hasn't yet been declared on the object you get that error. (I admit the way I formatted the tutorial there is a bit backward)