Resize window and object in class

I was hoping that the fact the constructor uses width and height to initiate the object would account for those changes but I guess it passes the value not the “reference”.
Thanks