GTK4PythonTutorial icon indicating copy to clipboard operation
GTK4PythonTutorial copied to clipboard

Non-functioning code in the "Open with" and single instancing section.

Open thechosenzendro opened this issue 2 years ago • 1 comments

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?

thechosenzendro avatar May 16 '23 17:05 thechosenzendro

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)

Taiko2k avatar May 16 '23 22:05 Taiko2k