Taiko2k / GTK4PythonTutorial

GTK4 + Python tutorial with code examples
446 stars 33 forks source link

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

Open thechosenzendro opened 1 year ago

thechosenzendro commented 1 year ago

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?

Taiko2k commented 1 year ago

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)